mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
* objcopy.c (add_redefine_syms_file): Avoid symbol buffer
overrun.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2009-12-31 Eirik Byrkjeflot Anonsen <eirik@opera.com>
|
||||||
|
Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* objcopy.c (add_redefine_syms_file): Avoid symbol buffer
|
||||||
|
overrun.
|
||||||
|
|
||||||
2009-12-21 Alan Modra <amodra@gmail.com>
|
2009-12-21 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* MAINTAINERS: Update my email address.
|
* MAINTAINERS: Update my email address.
|
||||||
|
@ -1232,7 +1232,7 @@ add_redefine_syms_file (const char *filename)
|
|||||||
filename, strerror (errno));
|
filename, strerror (errno));
|
||||||
|
|
||||||
bufsize = 100;
|
bufsize = 100;
|
||||||
buf = (char *) xmalloc (bufsize);
|
buf = (char *) xmalloc (bufsize + 1 /* For the terminating NUL. */);
|
||||||
|
|
||||||
lineno = 1;
|
lineno = 1;
|
||||||
c = getc (file);
|
c = getc (file);
|
||||||
@ -1249,7 +1249,7 @@ add_redefine_syms_file (const char *filename)
|
|||||||
if (len >= bufsize)
|
if (len >= bufsize)
|
||||||
{
|
{
|
||||||
bufsize *= 2;
|
bufsize *= 2;
|
||||||
buf = (char *) xrealloc (buf, bufsize);
|
buf = (char *) xrealloc (buf, bufsize + 1);
|
||||||
}
|
}
|
||||||
c = getc (file);
|
c = getc (file);
|
||||||
}
|
}
|
||||||
@ -1275,7 +1275,7 @@ add_redefine_syms_file (const char *filename)
|
|||||||
if (len >= bufsize)
|
if (len >= bufsize)
|
||||||
{
|
{
|
||||||
bufsize *= 2;
|
bufsize *= 2;
|
||||||
buf = (char *) xrealloc (buf, bufsize);
|
buf = (char *) xrealloc (buf, bufsize + 1);
|
||||||
}
|
}
|
||||||
c = getc (file);
|
c = getc (file);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user