diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 8 | ||||
-rw-r--r-- | util/secmem.c | 8 | ||||
-rw-r--r-- | util/strgutil.c | 3 |
3 files changed, 15 insertions, 4 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index 12b9ba4c6..f47cfdde7 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,11 @@ +Wed Sep 6 14:59:09 CEST 2000 Werner Koch <[email protected]> + + * secmem.c (secmem_realloc): check for failed secmem_malloc. By + Matt Kraai. + + * strgutil.c (utf8_to_native): Fixed null ptr problem. By + Giampaolo Tomassoni. + Thu Jul 27 10:02:38 CEST 2000 Werner Koch <[email protected]> * iobuf.c: Use setmode() at several places to set stdin and stdout diff --git a/util/secmem.c b/util/secmem.c index 8b80370c1..308b6bb46 100644 --- a/util/secmem.c +++ b/util/secmem.c @@ -347,9 +347,11 @@ secmem_realloc( void *p, size_t newsize ) if( newsize < size ) return p; /* it is easier not to shrink the memory */ a = secmem_malloc( newsize ); - memcpy(a, p, size); - memset((char*)a+size, 0, newsize-size); - secmem_free(p); + if ( a ) { + memcpy(a, p, size); + memset((char*)a+size, 0, newsize-size); + secmem_free(p); + } return a; } diff --git a/util/strgutil.c b/util/strgutil.c index 861bf0d6b..1308bb0af 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -424,7 +424,8 @@ utf8_to_native( const char *string, size_t length ) case 0 : n++; if( p ) *p++ = '0'; break; default: n += 3; sprintf( p, "x%02x", *s ); - p += 3; + if ( p ) + p += 3; break; } } |