diff options
author | Alan Modra <amodra@gmail.com> | 2014-10-14 13:30:57 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-10-14 14:04:11 +1030 |
commit | 9495b2e66f772783eb89cfa755e1e09641fa44eb (patch) | |
tree | bdccf42940c4914b36188934e0c00ec4f43c5d4d /binutils/readelf.c | |
parent | daf5e10e4cb2c5e502950dae5da5936d9a3d5a79 (diff) | |
download | gdb-9495b2e66f772783eb89cfa755e1e09641fa44eb.zip gdb-9495b2e66f772783eb89cfa755e1e09641fa44eb.tar.gz gdb-9495b2e66f772783eb89cfa755e1e09641fa44eb.tar.bz2 |
Correct fscanf char field count
%<number>s as an fscanf format does not include the trailing NULL.
PATH_MAX does include the trailing NULL.
PR 17453
* readelf.c (process_program_headers): Correct fscanf format used
for interpreter.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index 3cf46d8..58ccd93 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -4394,7 +4394,7 @@ process_program_headers (FILE * file) else { char fmt [32]; - int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX); + int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX - 1); if (ret >= (int) sizeof (fmt) || ret < 0) error (_("Internal error: failed to create format string to display program interpreter\n")); |