From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu From: "Skip Tavakkolian" MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] libc/strcmp bug? Date: Fri, 9 Aug 2002 20:35:27 -0400 Topicbox-Message-UUID: d9851630-eaca-11e9-9e20-41e7f4b1d025 I believe there is a bug in /sys/src/libc/port/strcmp.c, because it does not check for null pointers getting passed in before dereferencing them. I ran into it when attempting to Post some mail; 'marshal' dies with this message: marshal 2014: suicide: sys: trap: fault read addr=0x0 pc=0x00006feb Inspection points to the strcmp: term% acid 2014 /proc/2014/text:386 plan 9 executable /sys/lib/acid/port /sys/lib/acid/386 acid: stk() At pc:0x00006feb:strcmp+0xe /sys/src/libc/port/strcmp.c:10 strcmp(s1=0x00000000,s2=0x00013c5a) /sys/src/libc/port/strcmp.c:5 called from islikeatty+0x32 /sys/src/cmd/upas/common/libsys.c:709 islikeatty(fd=0x00000000) /sys/src/cmd/upas/common/libsys.c:701 called from holdon+0xf /sys/src/cmd/upas/common/libsys.c:719 holdon() /sys/src/cmd/upas/common/libsys.c:715 called from main+0x856 /sys/src/cmd/upas/marshal/marshal.c:271 main(argv=0x7fffefec,argc=0x00000000) /sys/src/cmd/upas/marshal/marshal.c:162 called from _main+0x31 /sys/src/libc/386/main9.s:16 acid: I'm not sure why the first arg to strcmp was null. I'm still investigating.