From 68ec1c0cfe7cd0e24fb6504808ddd0160c22c1e3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 9 Feb 2012 00:52:26 -0500 Subject: gp_conv: return GSS_C_NO_OID if input is null or zero length. Fixes useless allocation in gp_conv_gssx_to_oid_alloc() --- proxy/src/gp_conv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy/src/gp_conv.c b/proxy/src/gp_conv.c index 7f37be2..7855203 100644 --- a/proxy/src/gp_conv.c +++ b/proxy/src/gp_conv.c @@ -95,6 +95,11 @@ int gp_conv_gssx_to_oid_alloc(gssx_OID *in, gss_OID *out) { gss_OID o; + if (in == NULL || in->octet_string_len == 0) { + *out = GSS_C_NO_OID; + return 0; + } + o = calloc(1, sizeof(gss_OID_desc)); if (!o) { return ENOMEM; -- cgit