objcopy add-symbol uninitialised struct

* objcopy.c: Formatting, whitespace throughout.
	(copy_main): Init newsym->othersym.
	(parse_symflags): Make len a size_t.  Adjust uses.
This commit is contained in:
Alan Modra
2016-05-31 20:21:09 +09:30
parent c12969f8b5
commit f7433f011e
2 changed files with 119 additions and 110 deletions

View File

@ -1,3 +1,9 @@
2016-05-31 Alan Modra <amodra@gmail.com>
* objcopy.c: Formatting, whitespace throughout.
(copy_main): Init newsym->othersym.
(parse_symflags): Make len a size_t. Adjust uses.
2016-05-25 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/14625

View File

@ -757,7 +757,7 @@ parse_symflags (const char *s, char **other)
{
flagword ret;
const char *snext;
int len;
size_t len;
ret = BSF_NO_FLAGS;
@ -773,11 +773,13 @@ parse_symflags (const char *s, char **other)
}
#define PARSE_FLAG(fname, fval) \
else if (len == (int) sizeof fname - 1 && strncasecmp (fname, s, len) == 0) \
else if (len == sizeof fname - 1 \
&& strncasecmp (fname, s, len) == 0) \
ret |= fval
#define PARSE_OTHER(fname, fval) \
else if (len >= (int) sizeof fname && strncasecmp (fname, s, sizeof fname - 1) == 0) \
else if (len >= sizeof fname \
&& strncasecmp (fname, s, sizeof fname - 1) == 0) \
fval = xstrndup (s + sizeof fname - 1, len - sizeof fname + 1)
if (0) ;
@ -4127,6 +4129,7 @@ copy_main (int argc, char *argv[])
}
t = strchr (t + 1, ',');
newsym->othersym = NULL;
if (t)
newsym->flags = parse_symflags (t+1, &newsym->othersym);
else