diff options
author | Simo Sorce <simo@redhat.com> | 2012-02-09 00:52:26 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-02-09 01:36:07 -0500 |
commit | 68ec1c0cfe7cd0e24fb6504808ddd0160c22c1e3 (patch) | |
tree | 6dbc638c43d30250b28ea0257c2b6eefc6be1740 | |
parent | b9dfe62b8f1ce4101ae7b330f4e026acfa845cfb (diff) | |
download | gss-proxy-68ec1c0cfe7cd0e24fb6504808ddd0160c22c1e3.tar.gz gss-proxy-68ec1c0cfe7cd0e24fb6504808ddd0160c22c1e3.tar.xz gss-proxy-68ec1c0cfe7cd0e24fb6504808ddd0160c22c1e3.zip |
gp_conv: return GSS_C_NO_OID if input is null or zero length.
Fixes useless allocation in gp_conv_gssx_to_oid_alloc()
-rw-r--r-- | proxy/src/gp_conv.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |