libmspack icon indicating copy to clipboard operation
libmspack copied to clipboard

Fixed runtime error and uninitialized variable usage

Open wargio opened this issue 3 years ago • 0 comments

I have embedded libmspack in rizin and we had these issues raised by our CI

+../subprojects/libmspack/libmspack/mspack/cabd.c:1403:66: runtime error: left shift of 156 by 24 places cannot be represented in type 'int'
../subprojects/libmspack/libmspack/mspack/chmd.c: In function ‘chmd_extract’:
../subprojects/libmspack/libmspack/mspack/chmd.c:1139:10: error: ‘length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
1139 |   length -= self->d->offset;
     |          ^~
../subprojects/libmspack/libmspack/mspack/chmd.c:1042:9: note: ‘length’ was declared here
1042 |   off_t length, offset;
     |         ^~~~~~
cc1: all warnings being treated as errors

If interested i have a working meson configuration for the project.

wargio avatar Jun 27 '22 21:06 wargio