diff options
author | Cristian RodrÃguez <crrodriguez@opensuse.org> | 2013-05-22 18:22:37 -0400 |
---|---|---|
committer | Cristian RodrÃguez <crrodriguez@opensuse.org> | 2013-05-22 18:22:37 -0400 |
commit | 5a39544b215c99e93ba435aa4a671b0192329c08 (patch) | |
tree | 521c5e0956aee59d382e7e01bf8ee92c2493ef00 | |
parent | 39c6de4c8788fae91e008cc686db1d1e65b8bbc5 (diff) | |
download | procps-ng-5a39544b215c99e93ba435aa4a671b0192329c08.tar.gz |
Fix off-by-one in pmap
When procps is built with gcc 4.8 address sanitizer
static int one_proc(proc_t * p)..
..
char smap_key[20];
...
(sscanf(mapbuf, "%20[^:]: %llu", smap_key..
rightfully results in an overflow and the program aborts.
-rw-r--r-- | pmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -591,7 +591,7 @@ static int one_proc(proc_t * p) unsigned long long file_offset, inode; unsigned dev_major, dev_minor; unsigned long long smap_value; - char smap_key[20]; + char smap_key[21]; /* hex values are lower case or numeric, keys are upper */ if (mapbuf[0] >= 'A' && mapbuf[0] <= 'Z') { |