mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
Fix potential NULL pointer deref, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
b71605c819
commit
0be4838e01
1 file changed
+3
-1
+3
-1
@@ -419,8 +419,10 @@ int sh(char *tty)
|
||||
/* Start /bin/sh as a login shell, i.e. with a prefix '-' */
|
||||
len = strlen(_PATH_BSHELL) + 2;
|
||||
arg0 = malloc(len);
|
||||
if (!arg0)
|
||||
if (!arg0) {
|
||||
err(1, "Failed allocating memory");
|
||||
return 1;
|
||||
}
|
||||
snprintf(arg0, len, "-%s", _PATH_BSHELL);
|
||||
args[0] = arg0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user