[Toybox] [PATCH] gpiod: fix foreach_chip crashes.

enh enh at google.com
Fri Jun 9 22:05:18 PDT 2023


This was segfaulting because the loop copying the chips into the array
was corrupting the list, and because the llist_traverse was being given
the wrong pointer.

The strdup wasn't failing, but should be an xstrdup anyway. (I think
all the strdups in toys/ should actually be xstrdups. Maybe we should
even poison strdup, or just `#define strdup xstrdup`?)
---
 toys/other/gpiod.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230609/70f349cf/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gpiod-fix-foreach_chip-crashes.patch
Type: text/x-patch
Size: 1943 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230609/70f349cf/attachment-0001.bin>


More information about the Toybox mailing list