Missing NULL checks - qmi-proxy.c

Aleksander Morgado aleksander at aleksander.es
Mon Dec 21 14:31:29 UTC 2020


Hey,

> >
> >> Here are some trivial null checks I found during testing.  I believe there are
> >> some more issues remaining.  This is against both latest release 1.2.26.6 and
> >> current git.
> >>
> >
> > Are any of these new checks added to fix bugs? Or just through code review?
> > See comments below.
>
> Bug fixes.   Found with GDB, for example:
>
> Thread 1 "qmi-proxy" received signal SIGSEGV, Segmentation fault.
> 0x77c93d41 in qmi_client_info_array_lookup_cid (array=0x0,
> service=QMI_SERVICE_LOC, cid=2 '<error reading variable>) at qmi-proxy.c:544
> 544     qmi-proxy.c: No such file or directory.
> (gdb) bt
> #0  0x77c93d41 in qmi_client_info_array_lookup_cid (array=0x0,
> service=QMI_SERVICE_LOC, cid=2 '<error reading variable>) at qmi-proxy.c:544
> #1  0x77c94581 in track_implicit_cid (self=0x77958a10, client=0x41c678,
> message=0x416a00) at qmi-proxy.c:675
> #2  0x77c94e9b in process_message (self=0x77958a10, client=0x41c678,
> message=0x416a00) at qmi-proxy.c:853
> #3  0x77c94fad in parse_request (self=0x77958a10, client=0x41c678) at
> qmi-proxy.c:905
> #4  0x77c9513f in connection_readable_cb (warning: GDB can't find the start of
> the function at 0x77b5717e.
>

Under gdb, could you print all the contents of the "client" struct?
e.g. in context #1.

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list