summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-04-02 19:24:52 +0000
committerEric Andersen <andersen@codepoet.org>2002-04-02 19:24:52 +0000
commitabdb41c778c5892d51fe92879d383eb8ba000028 (patch)
treebad5fd6191490e278f0582ea9cc5d9be19338487
parent4fea5868d240fc3354309df8bf6673735a0ab903 (diff)
Doh! This is _still_ wrong. Fix potential buffer overflow.
-Erik
-rw-r--r--ldso/ldso/ld_string.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/ldso/ldso/ld_string.h b/ldso/ldso/ld_string.h
index b94b1c5f9..d872a6f13 100644
--- a/ldso/ldso/ld_string.h
+++ b/ldso/ldso/ld_string.h
@@ -193,7 +193,7 @@ static inline char *_dl_get_last_path_component(char *path)
static inline char *_dl_simple_ltoa(char * local, unsigned long i)
{
/* 21 digits plus null terminator, good for 64-bit or smaller ints */
- char *p = &local[21];
+ char *p = &local[22];
*p-- = '\0';
do {
*p-- = '0' + i % 10;
@@ -205,7 +205,7 @@ static inline char *_dl_simple_ltoa(char * local, unsigned long i)
static inline char *_dl_simple_ltoahex(char * local, unsigned long i)
{
/* 21 digits plus null terminator, good for 64-bit or smaller ints */
- char *p = &local[21];
+ char *p = &local[22];
*p-- = '\0';
do {
char temp = i % 0x10;
@@ -234,7 +234,7 @@ static inline char *_dl_simple_ltoahex(char * local, unsigned long i)
#endif
#define SEND_ADDRESS_STDERR(X, add_a_newline) { \
- char tmp[13], *tmp1; \
+ char tmp[22], *tmp1; \
_dl_memset(tmp, 0, sizeof(tmp)); \
tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
_dl_write(2, tmp1, _dl_strlen(tmp1)); \
@@ -245,7 +245,7 @@ static inline char *_dl_simple_ltoahex(char * local, unsigned long i)
};
#define SEND_NUMBER_STDERR(X, add_a_newline) { \
- char tmp[13], *tmp1; \
+ char tmp[22], *tmp1; \
_dl_memset(tmp, 0, sizeof(tmp)); \
tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
_dl_write(2, tmp1, _dl_strlen(tmp1)); \