# HG changeset patch # User carl # Date 1186954215 25200 # Node ID f5c024aa1dc54b0aec89f10f575cb69a75423b65 # Parent ddfb25318812f98ff35380b46c292819f42aa385 more valgrind fixes diff -r ddfb25318812 -r f5c024aa1dc5 ChangeLog --- a/ChangeLog Fri Aug 10 08:06:13 2007 -0700 +++ b/ChangeLog Sun Aug 12 14:30:15 2007 -0700 @@ -1,3 +1,8 @@ +LibPST 0.5.9 (2007-08-12) +=============================== + + * fix more valgrind errors. + LibPST 0.5.8 (2007-08-10) =============================== diff -r ddfb25318812 -r f5c024aa1dc5 NEWS --- a/NEWS Fri Aug 10 08:06:13 2007 -0700 +++ b/NEWS Sun Aug 12 14:30:15 2007 -0700 @@ -1,5 +1,7 @@ $Id$ +0.5.9 2007-08-12 fix more valgrind errors, pst2ldif wrote undefined data +0.5.8 2007-08-10 lzfu_decompress/base64_encode encoded random data into attachment 0.5.7 2007-08-09 fix valgrind errors, using uninitialized data 0.5.6 2007-07-15 handle small pst files, better decoding of 7c blocks 0.5.5 2007-07-10 merge changes from Joe Nahmias version diff -r ddfb25318812 -r f5c024aa1dc5 configure.in --- a/configure.in Fri Aug 10 08:06:13 2007 -0700 +++ b/configure.in Sun Aug 12 14:30:15 2007 -0700 @@ -1,7 +1,7 @@ AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libpst,0.5.8) +AM_INIT_AUTOMAKE(libpst,0.5.9) AC_PATH_PROGS(BASH, bash) AC_LANG_CPLUSPLUS diff -r ddfb25318812 -r f5c024aa1dc5 src/pst2ldif.cpp --- a/src/pst2ldif.cpp Fri Aug 10 08:06:13 2007 -0700 +++ b/src/pst2ldif.cpp Sun Aug 12 14:30:15 2007 -0700 @@ -556,25 +556,26 @@ else { // calculate space required to escape all the following characters - x = strlen(str) +(y=(chr_count(str, ',')*2) + (chr_count(str, '\\')*2) + (chr_count(str, ';')*2) + (chr_count(str, '\n')*2)); + y = chr_count(str, '\\') + + chr_count(str, ';'); z = chr_count(str, '\r'); if (y == 0 && z == 0) // there isn't any extra space required ret = str; else { - buf = (char*) realloc(buf, x+1); + x = strlen(str) + y - z + 1; // don't forget room for the NUL + buf = (char*) realloc(buf, x); a = str; b = buf; while (*a != '\0') { switch(*a) { - // case ',' : case '\\': case ';' : - // case '\n': *(b++)='\\'; *b=*a; break; - case '\r': + case '\r': // skip cr + b--; break; default: *b=*a; @@ -582,7 +583,7 @@ b++; a++; } - *b = '\0'; + *b = '\0'; // NUL-terminate the string (buf) ret = buf; } } diff -r ddfb25318812 -r f5c024aa1dc5 src/readpst.c --- a/src/readpst.c Fri Aug 10 08:06:13 2007 -0700 +++ b/src/readpst.c Sun Aug 12 14:30:15 2007 -0700 @@ -822,11 +822,11 @@ + chr_count(str, ';') + chr_count(str, '\n'); z = chr_count(str, '\r'); - x = strlen(str) + y - z + 1; // don't forget room for the NUL if (y == 0 && z == 0) // there isn't any extra space required ret = str; else { + x = strlen(str) + y - z + 1; // don't forget room for the NUL buf = (char*) realloc(buf, x); a = str; b = buf;