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

Greg Hudson ghudson at mit.edu
Fri Aug 31 01:52:32 EDT 2018


https://github.com/krb5/krb5/commit/80a68906edbb6d0d179ee724822157e3145f74cd
commit 80a68906edbb6d0d179ee724822157e3145f74cd
Author: Greg Hudson <ghudson at mit.edu>
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);


More information about the cvs-krb5 mailing list