On Sun, 2021-06-27 at 13:29 -0500, Alexandre Ferreira wrote:
>
> The driver jp-3478a uses the dfi parameter before testing the key on
> the config+list function. The function sr_dev_options call
> driver->config_list and explicitly says that sdi can be NULL for
> just checking driver options.
> The patch attached moves the offending line to inside the option of
> the switch that uses that variable. That solves the pulseview seg
> fault on startup.
> The diff is against master on the git://sigrok.org/libsigrok

While the analysis of the problem is correct, the patch that you
provided is not a reliable fix. Compilers are free to rearrange
the order of instructions as long as the result will be the same
as a naive compilation. So moving the source code line need not
result in a different execution order than the one which made you
see the problem.

Since you provided a diff but not a commit, unnecessary extra
work remained on the recipient's side. And when I had to do this
extra work on the change, it's when I decided to take a different
approach instead. Check the 'sdi' value's being valid before
dereferencing it.

This went mainline today. Your issue should be fixed in current
master. See commit 020df861e0eb. I gave you a Reported-By to
acknowledge your contribution. Thank you!


virtually yours
Gerhard Sittig
--
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to