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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/auxprogs/valgrind-di-server.c b/auxprogs/valgrind-di-server.c
index 85c1370..4a16afd 100644
--- a/auxprogs/valgrind-di-server.c
+++ b/auxprogs/valgrind-di-server.c
@@ -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);
diff --git a/coregrind/m_debuginfo/image.c b/coregrind/m_debuginfo/image.c
index 02a367d..dfe077f 100644
--- a/coregrind/m_debuginfo/image.c
+++ b/coregrind/m_debuginfo/image.c
@@ -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;