summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-02-11 19:59:17 +0000
committerJeremy Allison <jra@samba.org>2004-02-11 19:59:17 +0000
commit987083010441d091d693d6114a7015d5f05d6cd7 (patch)
tree6164de4abb6c0f313630b7cf62a5af1d22215d62 /source3
parent90b5adc557e54607e6a7aef273819f11982562c4 (diff)
downloadsamba-987083010441d091d693d6114a7015d5f05d6cd7.tar.gz
samba-987083010441d091d693d6114a7015d5f05d6cd7.tar.bz2
samba-987083010441d091d693d6114a7015d5f05d6cd7.zip
Paranoia fixes :-).
Jeremy. (This used to be commit 86b030197db63ac0a04b8ea877d80a3d74a7a187)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/asn1.c8
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);