From abdb41c778c5892d51fe92879d383eb8ba000028 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 2 Apr 2002 19:24:52 +0000 Subject: Doh! This is _still_ wrong. Fix potential buffer overflow. -Erik --- ldso/ldso/ld_string.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ldso/ldso') 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)); \ -- cgit v1.2.3