]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
The 4th parameter of lzo1x_decompress_safe has lzo_uint * type
authorFlorian Krohm <florian@eich-krohm.de>
Tue, 2 Sep 2014 12:05:15 +0000 (12:05 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Tue, 2 Sep 2014 12:05:15 +0000 (12:05 +0000)
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

auxprogs/valgrind-di-server.c
coregrind/m_debuginfo/image.c

index 85c13702f73f61ceec69b6a86f19a745efa5d976..4a16afd89166959206f441453ee617aecd004e88 100644 (file)
@@ -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);
index 02a367d4d496557e6ee8569f9d4d2cfbbeac9c4a..dfe077fd457186849ef7b5310bad82021f693d3e 100644 (file)
@@ -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;