Actions
Bug #9713
closedlibstand: cd9660 pointers differ in signedness
Start date:
2018-08-08
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
Build with warnings enabled did reveal the problem with cd9660 reader. The 9660 data structures are defined as char arrays, yes the functions are expecting unsigned chars. Change the related members to unsigned.
/code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: In function 'susp_loo kup_record': /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:129:28: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=poi nter-sign] p = dp->name + isonum_711(dp->name_len) + lenskip; ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: 45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:131:18: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=poi nter-sign] if ((isonum_711(dp->name_len) & 1) == 0) ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: 45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:133:32: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=poi nter-sign] end = (char *)dp + isonum_711(dp->length); ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: 45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:143:28: error: pointer targets in passing argument 1 of 'isonum_733' differ in signedness [-Werror=poi nter-sign] cdb2devb(isonum_733(shc->location)), ^ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:116:25: note: in defin ition of macro 'cdb2devb' #define cdb2devb(bno) ((bno) * ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE) ^~~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: 45:: ../../../../include/isofs/cd9660/iso.h:350:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_733(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:149:33: error: pointer targets in passing argument 1 of 'isonum_733' differ in signedness [-Werror=poi nter-sign] p = susp_buffer + isonum_733(shc->offset); ^~~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:350:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_733(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:150:25: error: pointer targets in passing argument 1 of 'isonum_733' differ in signedness [-Werror=pointer-sign] end = p + isonum_733(shc->length); ^~~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:350:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_733(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: In function 'rrip_check': /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:202:28: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] p = dp->name + isonum_711(dp->name_len); ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:203:34: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if (p > (char *)dp + isonum_711(dp->length)) ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: In function 'dirmatch': /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:238:20: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] len = isonum_711(dp->name_len); ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: In function 'cd9660_open': /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:298:18: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if (isonum_711(vd->type) == ISO_VD_END) ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:300:18: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if (isonum_711(vd->type) == ISO_VD_PRIMARY) ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:303:17: error: pointer targets in passing argument 1 of 'isonum_723' differ in signedness [-Werror=pointer-sign] if (isonum_723(vd->logical_block_size) != ISO_DEFAULT_BLOCK_SIZE) ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:329:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_723(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:312:45: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); ^~~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:334:19: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if (isonum_711(dp->length) == 0) { ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:352:31: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] ((char *) dp + isonum_711(dp->length)); ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:354:19: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if (isonum_711(dp->length) == 0) { ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:359:22: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] off += isonum_711(dp->length); ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:377:18: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if ((isonum_711(rec.flags) & 2) != 0) { ^~~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:384:45: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); ^~~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:402:50: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] fp->f_bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); ^~~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c: In function 'cd9660_readdir': /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:509:17: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if (isonum_711(ep->length) == 0) { ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:527:24: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] namelen = isonum_711(ep->name_len); ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:543:17: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] if (isonum_711(ep->flags) & 2) ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:552:26: error: pointer targets in passing argument 1 of 'isonum_711' differ in signedness [-Werror=pointer-sign] fp->f_off += isonum_711(ep->length); ^~ In file included from /code/illumos-gate/usr/src/boot/lib/libstand/cd9660.c:45:: ../../../../include/isofs/cd9660/iso.h:294:1: note: expected 'const unsigned char *' but argument is of type 'char *' isonum_711(const unsigned char *p) ^~~~~~~~~~ cc1: all warnings being treated as errors
Updated by Electric Monk over 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 5620b343930008e3d99871d6563033c0cbe44afa
commit 5620b343930008e3d99871d6563033c0cbe44afa Author: Toomas Soome <tsoome@me.com> Date: 2018-08-09T15:06:13.000Z 9713 libstand: cd9660 pointers differ in signedness Reviewed by: Yuri Pankov <yuripv@yuripv.net> Approved by: Dan McDonald <danmcd@joyent.com>
Actions