#1071186 units --round: null pointer dereference

Package:
units
Source:
units
Description:
converts between different systems of units
Submitter:
Jakub Wilk
Date:
2024-05-15 15:27:03 UTC
Severity:
normal
#1071186#3
Date:
2024-05-15 15:24:47 UTC
From:
To:
I've run into this:

     $ units --round 0.1s hms
     Segmentation fault

GDB says it's a null pointer dereference:

    Program received signal SIGSEGV, Segmentation fault.
    0x56563973 in showunitlist (havestr=0xffffd9d3 "0.1s", have=0x565722c0 <have>, wantstr=<optimized out>) at ./units.c:5577
    5577        if (isdecimal(*lastunitstr))
    (gdb) print lastunitstr
    $1 = 0x0
    (gdb) bt
    #0  0x56563973 in showunitlist (havestr=0xffffd9d3 "0.1s", have=0x565722c0 <have>, wantstr=<optimized out>) at ./units.c:5577
    #1  0x565580a5 in main (argc=4, argv=0xffffd7e4) at ./units.c:6235