summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-02-11 23:25:49 +0000
committerJeremy Allison <jra@samba.org>2004-02-11 23:25:49 +0000
commited1862b3b21d1cbe4a013838bf5c581c600657c2 (patch)
tree780d28d277b3c1c77bc17291a03d2dac7e6665e2 /source3/libsmb
parentc177b9ef11f0e3048684824bf1cd08a5bd1f975f (diff)
downloadsamba-ed1862b3b21d1cbe4a013838bf5c581c600657c2.tar.gz
samba-ed1862b3b21d1cbe4a013838bf5c581c600657c2.tar.bz2
samba-ed1862b3b21d1cbe4a013838bf5c581c600657c2.zip
More paranoia checks.
Jeremy. (This used to be commit 4920f9bd660e22c8ac3ba1c389781f2efbcd1e78)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/asn1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/libsmb/asn1.c b/source3/libsmb/asn1.c
index 17170b015f..ecc5e3dee6 100644
--- a/source3/libsmb/asn1.c
+++ b/source3/libsmb/asn1.c
@@ -219,6 +219,11 @@ BOOL asn1_load(ASN1_DATA *data, DATA_BLOB blob)
/* read from a ASN1 buffer, advancing the buffer pointer */
BOOL asn1_read(ASN1_DATA *data, void *p, int len)
{
+ if (len < 0 || data->ofs + len < data->ofs || data->ofs + len < len) {
+ data->has_error = True;
+ return False;
+ }
+
if (data->ofs + len > data->length) {
data->has_error = True;
return False;