git.samba.org
/
jra
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c177b9e
)
More paranoia checks.
author
Jeremy Allison
<jra@samba.org>
Wed, 11 Feb 2004 23:25:49 +0000
(23:25 +0000)
committer
Jeremy Allison
<jra@samba.org>
Wed, 11 Feb 2004 23:25:49 +0000
(23:25 +0000)
Jeremy.
(This used to be commit
4920f9bd660e22c8ac3ba1c389781f2efbcd1e78
)
source3/libsmb/asn1.c
patch
|
blob
|
history
diff --git
a/source3/libsmb/asn1.c
b/source3/libsmb/asn1.c
index 17170b015f3017d9d21bf031f2342779c2a096b1..ecc5e3dee641b949034370d2a0c4dc975707052c 100644
(file)
--- 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;