diff options
author | Jeremy Allison <jra@samba.org> | 2004-02-11 19:59:14 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-02-11 19:59:14 +0000 |
commit | c177b9ef11f0e3048684824bf1cd08a5bd1f975f (patch) | |
tree | b5c5c38c940c19dbe5437d329e6ad24e4180c745 /source3/libsmb | |
parent | 899a09d713d42ca7ffcf78f828e1bac558d54332 (diff) | |
download | samba-c177b9ef11f0e3048684824bf1cd08a5bd1f975f.tar.gz samba-c177b9ef11f0e3048684824bf1cd08a5bd1f975f.tar.bz2 samba-c177b9ef11f0e3048684824bf1cd08a5bd1f975f.zip |
Paranoia fixes :-).
Jeremy.
(This used to be commit 35bbc818ad28c3591df9d5cb0a674802f3f29e1a)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/asn1.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/libsmb/asn1.c b/source3/libsmb/asn1.c index 576491dd3b..17170b015f 100644 --- a/source3/libsmb/asn1.c +++ b/source3/libsmb/asn1.c @@ -365,6 +365,10 @@ BOOL asn1_read_GeneralString(ASN1_DATA *data, char **s) int len; if (!asn1_start_tag(data, ASN1_GENERAL_STRING)) return False; len = asn1_tag_remaining(data); + if (len < 0) { + data->has_error = True; + return False; + } *s = malloc(len+1); if (! *s) { data->has_error = True; @@ -383,6 +387,10 @@ BOOL asn1_read_OctetString(ASN1_DATA *data, DATA_BLOB *blob) ZERO_STRUCTP(blob); if (!asn1_start_tag(data, ASN1_OCTET_STRING)) return False; len = asn1_tag_remaining(data); + if (len < 0) { + data->has_error = True; + return False; + } *blob = data_blob(NULL, len); asn1_read(data, blob->data, len); asn1_end_tag(data); |