krb5 commit: Check output params on GSS OID set functions

Greg Hudson ghudson at mit.edu
Thu Oct 1 14:27:41 EDT 2015


https://github.com/krb5/krb5/commit/c9e035794caa784b6cdf416e2b3f1d641d011390
commit c9e035794caa784b6cdf416e2b3f1d641d011390
Author: Tomas Kuthan <tkuthan at gmail.com>
Date:   Wed Sep 30 15:18:05 2015 +0200

    Check output params on GSS OID set functions
    
    Add sanity checks for the output parameters of
    generic_gss_create_empty_oid_set() and
    generic_gss_add_oid_set_member(), which are used directly by the API
    functions gss_create_empty_oid_set() and gss_add_oid_set_member().
    
    [ghudson at mit.edu: edit commit message]
    
    ticket: 8259 (new)
    target_version: 1.14
    tags: pullup

 src/lib/gssapi/generic/oid_ops.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/lib/gssapi/generic/oid_ops.c b/src/lib/gssapi/generic/oid_ops.c
index 5ad02fc..6e294b9 100644
--- a/src/lib/gssapi/generic/oid_ops.c
+++ b/src/lib/gssapi/generic/oid_ops.c
@@ -137,6 +137,9 @@ generic_gss_create_empty_oid_set(OM_uint32 *minor_status, gss_OID_set *oid_set)
 {
     *minor_status = 0;
 
+    if (oid_set == NULL)
+        return GSS_S_CALL_INACCESSIBLE_WRITE;
+
     if ((*oid_set = (gss_OID_set) gssalloc_malloc(sizeof(gss_OID_set_desc)))) {
         memset(*oid_set, 0, sizeof(gss_OID_set_desc));
         return(GSS_S_COMPLETE);
@@ -161,6 +164,9 @@ generic_gss_add_oid_set_member(OM_uint32 *minor_status,
         member_oid->elements == NULL)
         return (GSS_S_CALL_INACCESSIBLE_READ);
 
+    if (oid_set == NULL)
+        return GSS_S_CALL_INACCESSIBLE_WRITE;
+
     elist = (*oid_set)->elements;
     /* Get an enlarged copy of the array */
     if (((*oid_set)->elements = (gss_OID) gssalloc_malloc(((*oid_set)->count+1) *


More information about the cvs-krb5 mailing list