Re: [BUG] applying zero offset to null pointer growjobtab() src/jobs.c:819:34

Harald van Dijk <[email protected]> Thu, 31 Jul 2025 22:43:15 +0100
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
On 31/07/2025 19:12, Aleksander Ushakov wrote:
> Hello Dash maintainers,
> 
> I encountered a bug in Dash in commit b4ef25d7 and would like to report
> it. The details are provided below.
> 
> 
> jobs.c:819:34: runtime error: applying zero offset to null pointer
>      #0 0x5adb67991deb in growjobtab /upstream/ubsan/dash/src/jobs.c:819:34
>      #1 0x5adb67991985 in makejob /upstream/ubsan/dash/src/jobs.c:774:9
>      #2 0x5adb679937a8 in vforkexec /upstream/ubsan/dash/src/jobs.c:992:7
>      #3 0x5adb6796edcc in evalcommand /upstream/ubsan/dash/src/eval.c:916:9
>      #4 0x5adb6796c0ac in evaltree /upstream/ubsan/dash/src/eval.c:305:12
>      #5 0x5adb6799818c in cmdloop /upstream/ubsan/dash/src/main.c:246:8
>      #6 0x5adb67997e4b in main /upstream/ubsan/dash/src/main.c:180:3
>      #7 0x7a95463ad249 in __libc_start_call_main csu/../sysdeps/nptl/ 
> libc_start_call_main.h:58:16
>      #8 0x7a95463ad304 in __libc_start_main csu/../csu/libc-start.c:360:3
>      #9 0x5adb6793a930 in _start (/upstream/ubsan/dash/src/dash+0x42930) 
> (BuildId: bf877a87a1c989c4907f14ce16668321dedc5edd)
> 
> SUMMARY: UndefinedBehaviorSanitizer: nullptr-with-offset jobs.c:819:34

I believe this is covered by the same retroactively applied language 
change as the mempcpy issue you reported. That is, this is valid code 
now and sanitizers need to be updated to no longer flag it.

Cheers,
Harald van Dijk