krb5 commit: Check malloc() result in ss_execute_command()

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/80a68906edbb6d0d179ee724822157e3145f74cd
commit 80a68906edbb6d0d179ee724822157e3145f74cd
Author: Greg Hudson <[email protected]>
Date:   Wed Aug 29 15:40:24 2018 -0400

    Check malloc() result in ss_execute_command()
    
    Reported by Bean Zhang.

 src/util/ss/execute_cmd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/util/ss/execute_cmd.c b/src/util/ss/execute_cmd.c
index cbd697d..c06ee56 100644
--- a/src/util/ss/execute_cmd.c
+++ b/src/util/ss/execute_cmd.c
@@ -147,6 +147,8 @@ ss_execute_command(sci_idx, argv)
     for (argp = argv; *argp; argp++)
         argc++;
     argp = (char **)malloc((argc+1)*sizeof(char *));
+    if (argp == NULL)
+        return(ENOMEM);
     for (i = 0; i <= argc; i++)
         argp[i] = argv[i];
     ret = really_execute_command(sci_idx, argc, &argp);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.