summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-06-18 15:43:32 +0200
committerAndrew Bartlett <abartlet@samba.org>2015-06-24 01:03:16 +0200
commit9414d9867c51c0db3d7166b4afcf5ff5b39d64a1 (patch)
tree4ca7285489f683abaff681bec6d4a4bb3b0364e0 /source4/heimdal/lib
parent3b9e5cfd2318d96dfaf1b31526f578d7fb42ff7a (diff)
downloadsamba-9414d9867c51c0db3d7166b4afcf5ff5b39d64a1.tar.gz
heimdal:lib/gssapi/krb5: make _gssapi_verify_pad() more robust
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/heimdal/lib')
-rw-r--r--source4/heimdal/lib/gssapi/krb5/decapsulate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/heimdal/lib/gssapi/krb5/decapsulate.c b/source4/heimdal/lib/gssapi/krb5/decapsulate.c
index 640c064d0bf..86085f56950 100644
--- a/source4/heimdal/lib/gssapi/krb5/decapsulate.c
+++ b/source4/heimdal/lib/gssapi/krb5/decapsulate.c
@@ -190,6 +190,9 @@ _gssapi_verify_pad(gss_buffer_t wrapped_token,
size_t padlength;
int i;
+ if (wrapped_token->length < 1)
+ return GSS_S_BAD_MECH;
+
pad = (u_char *)wrapped_token->value + wrapped_token->length - 1;
padlength = *pad;