mirror of
https://github.com/systemd/systemd.git
synced 2026-07-25 00:35:55 +00:00
terminal-util: fix possible NULL pointer dereference
Fixes a bug introduced by 94a2b1cd25.
Fixes CID#1591787.
This commit is contained in:
committed by
Lennart Poettering
parent
134bb7bfdf
commit
a6eb22968c
@@ -419,7 +419,10 @@ int ask_string_full(
|
||||
/* Ctrl-u → erase all input */
|
||||
|
||||
clear_by_backspace(utf8_console_width(string));
|
||||
string[n = 0] = 0;
|
||||
if (string)
|
||||
string[n = 0] = 0;
|
||||
else
|
||||
assert(n == 0);
|
||||
|
||||
} else if (c == 4) {
|
||||
/* Ctrl-d → cancel this field input */
|
||||
|
||||
Reference in New Issue
Block a user