|
From: <sv...@va...> - 2014-09-02 12:05:24
|
Author: florian
Date: Tue Sep 2 12:05:15 2014
New Revision: 14431
Log:
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.
Modified:
trunk/auxprogs/valgrind-di-server.c
trunk/coregrind/m_debuginfo/image.c
Modified: trunk/auxprogs/valgrind-di-server.c
==============================================================================
--- trunk/auxprogs/valgrind-di-server.c (original)
+++ trunk/auxprogs/valgrind-di-server.c Tue Sep 2 12:05:15 2014
@@ -810,7 +810,7 @@
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 @@
# 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);
Modified: trunk/coregrind/m_debuginfo/image.c
==============================================================================
--- trunk/coregrind/m_debuginfo/image.c (original)
+++ trunk/coregrind/m_debuginfo/image.c Tue Sep 2 12:05:15 2014
@@ -493,9 +493,9 @@
// 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;
|