Menu

#321 g_strsplit: a broken usage

New
nobody
None
Critical
Defect
2020-10-20
2020-10-09
No

Since the commit 8bfcaf9, yad behaves incorrectly when a form field name is empty (fe. --field="":RO ). Either crashes at all, or some warnings in stderr looking like some usage of uninitialized data...

The problem is a little misunderstanding of the behavior of the glib-2.0 function g_strsplit(). According to the manual:

As a special case, the result of splitting the empty string "" is an empty vector, not a vector containing a single string.
...
If you do need to represent empty elements, you'll need to check for the empty string before calling g_strsplit().

The patch proposed fixes the issue (at least for my a bit complex case).

Surely it drops changes from some recent commits regarding src/option.c -- 17bd94, 8ba82ec (no comments... :) )

1 Attachments

Discussion

  • Victor Ananjevsky

    thanks, applied

     

Log in to post a comment.