krb5 commit: Fix error handling in k5_expand_path_tokens_extra

Greg Hudson ghudson at MIT.EDU
Sat Jul 12 15:19:26 EDT 2014


https://github.com/krb5/krb5/commit/44b633953c21569b3d1ceb05bda1cbb69ed4d38c
commit 44b633953c21569b3d1ceb05bda1cbb69ed4d38c
Author: Lukas Slebodnik <lslebodn at redhat.com>
Date:   Sat Jun 21 14:59:29 2014 +0200

    Fix error handling in k5_expand_path_tokens_extra
    
    If strdup fails when copying extra tokens, we must terminate the
    argument traversal before returning.
    
    [ghudson at mit.edu: clarified commit message]

 src/lib/krb5/os/expand_path.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/lib/krb5/os/expand_path.c b/src/lib/krb5/os/expand_path.c
index 144ccc8..4646c54 100644
--- a/src/lib/krb5/os/expand_path.c
+++ b/src/lib/krb5/os/expand_path.c
@@ -481,6 +481,7 @@ k5_expand_path_tokens_extra(krb5_context context, const char *path_in,
             extra_tokens[i] = strdup(va_arg(ap, const char *));
             if (extra_tokens[i] == NULL) {
                 ret = ENOMEM;
+                va_end(ap);
                 goto cleanup;
             }
         }


More information about the cvs-krb5 mailing list