diff options
| author | Johan Hedberg <johan.hedberg@intel.com> | 2016-09-07 08:45:12 +0300 |
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-09-10 17:05:03 +0300 |
| commit | 8514068150759c1d6a46d4605d2351babfde1601 (patch) | |
| tree | 960683c4e82f91953e0bce86bd187133221ef465 | |
| parent | 0a018b2d1a88813d528e1a9039ad07ec24da4a62 (diff) | |
tools/csr: Fix possible buffer overflow
Make sure we don't write past the end of the array.
| -rw-r--r-- | tools/csr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/csr.c b/tools/csr.c index 2c0918909..15ae7c4fb 100644 --- a/tools/csr.c +++ b/tools/csr.c @@ -2756,7 +2756,7 @@ static int parse_line(char *str) off++; - while (1) { + while (length <= sizeof(array) - 2) { value = strtol(off, &end, 16); if (value == 0 && off == end) break; |
