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

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