From: Florian Krohm Date: Tue, 2 Sep 2014 12:05:15 +0000 (+0000) Subject: The 4th parameter of lzo1x_decompress_safe has lzo_uint * type X-Git-Tag: svn/VALGRIND_3_10_0~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cf18881c56dace36936994ec58fc94b1142b12a;p=thirdparty%2Fvalgrind.git The 4th parameter of lzo1x_decompress_safe has lzo_uint * type which, despite the name, is a pointer to an unsigned long. So we should be passing arguments of matching type. Spotted by the Coverity checker. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14431 --- diff --git a/auxprogs/valgrind-di-server.c b/auxprogs/valgrind-di-server.c index 85c13702f7..4a16afd891 100644 --- a/auxprogs/valgrind-di-server.c +++ b/auxprogs/valgrind-di-server.c @@ -810,7 +810,7 @@ static Bool handle_transaction ( int conn_no ) free_Frame(res); res = mk_Frame_asciiz("FAIL", "READ: I/O error reading file"); ok = False; - } UInt zLen = 0; + } if (ok) { // Now compress it with LZO. LZO appears to recommend // the worst-case output size as (in_len + in_len / 16 + 67). @@ -823,9 +823,9 @@ static Bool handle_transaction ( int conn_no ) # undef STACK_ALLOC UInt zLenMax = req_len + req_len / 4 + 1024; UChar* zBuf = malloc(zLenMax); - zLen = zLenMax; + lzo_uint zLen = zLenMax; Int lzo_rc = lzo1x_1_compress(unzBuf, req_len, - zBuf, (lzo_uint*)&zLen, wrkmem); + zBuf, &zLen, wrkmem); if (lzo_rc == LZO_E_OK) { //printf("XXXXX req_len %u zLen %u\n", (UInt)req_len, (UInt)zLen); assert(zLen <= zLenMax); diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c index 02a367d4d4..dfe077fd45 100644 --- a/coregrind/m_debuginfo/image.c +++ b/coregrind/m_debuginfo/image.c @@ -493,9 +493,9 @@ static void set_CEnt ( DiImage* img, UInt entNo, DiOffT off ) // Tell the lib the max number of output bytes it can write. // After the call, this holds the number of bytes actually written, // and it's an error if it is different. - UInt out_len = len; + lzo_uint out_len = len; Int lzo_rc = lzo1x_decompress_safe(rx_data, rx_zdata_len, - &ce->data[0], (lzo_uint*)&out_len, + &ce->data[0], &out_len, NULL); Bool ok = lzo_rc == LZO_E_OK && out_len == len; if (!ok) goto server_fail;