mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-23 00:30:51 +02:00
nm-dispatcher: fix crash when parsing output dictionary
'stdout' is NULL when the script didn't write anything or failed. Fixes the following crash detected by NMCI in test 'dispatcher_device_handler_dummy'. nm-dispatcher[936339]: g_strsplit: assertion 'string != NULL' failed build_result_options (nm-dispatcher) complete_request (nm-dispatcher) complete_script (nm-dispatcher) script_watch_cb (nm-dispatcher) g_child_watch_dispatch (libglib-2.0.so.0) g_main_dispatch (libglib-2.0.so.0) g_main_context_iterate (libglib-2.0.so.0) g_main_context_iteration (libglib-2.0.so.0) main (nm-dispatcher) __libc_start_main (libc.so.6) _start (nm-dispatcher) Fixes:d72f26b875('dispatcher: read device-handler's stdout into a dictionary') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1889 (cherry picked from commite5c2c5f1c2)
This commit is contained in:
parent
d3329f0599
commit
669bf33de3
1 changed files with 3 additions and 0 deletions
|
|
@ -306,6 +306,9 @@ build_result_options(char *stdout)
|
|||
char *key;
|
||||
char *value;
|
||||
|
||||
if (!stdout)
|
||||
return NULL;
|
||||
|
||||
lines = g_strsplit(stdout, "\n", 65);
|
||||
|
||||
for (i = 0; lines[i] && i < 64; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue