Blame SOURCES/e2fsprogs-1.45.6-libss-fix-possible-NULL-pointer-dereferece-on-alloca.patch

f239de
From 422643f4758b0a0345d84b2d19312269472e2a00 Mon Sep 17 00:00:00 2001
f239de
From: Lukas Czerner <lczerner@redhat.com>
f239de
Date: Thu, 17 Feb 2022 10:24:59 +0100
f239de
Subject: [PATCH 2/2] libss: fix possible NULL pointer dereferece on allocation
f239de
 failure
f239de
Content-Type: text/plain
f239de
f239de
Currently in ss_execute_command() we're missng a check to see if the
f239de
memory allocation was succesful. Fix it by checking the return from
f239de
malloc and returning ENOMEM if it had failed.
f239de
f239de
[ Removed addition of the SS_ET_ENOMEM entry to the the libss error
f239de
  table.  -TYT ]
f239de
f239de
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
f239de
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
f239de
---
f239de
 lib/ss/execute_cmd.c | 2 ++
f239de
 1 file changed, 2 insertions(+)
f239de
f239de
diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c
f239de
index d443a468..2e2c8cfa 100644
f239de
--- a/lib/ss/execute_cmd.c
f239de
+++ b/lib/ss/execute_cmd.c
f239de
@@ -171,6 +171,8 @@ int ss_execute_command(int sci_idx, register char *argv[])
f239de
 	for (argp = argv; *argp; argp++)
f239de
 		argc++;
f239de
 	argp = (char **)malloc((argc+1)*sizeof(char *));
f239de
+	if (!argp)
f239de
+		return(ENOMEM);
f239de
 	for (i = 0; i <= argc; i++)
f239de
 		argp[i] = argv[i];
f239de
 	i = really_execute_command(sci_idx, argc, &argp);
f239de
-- 
f239de
2.35.1
f239de