diff options
author | Simon Rettberg | 2017-04-21 16:31:06 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-21 16:31:06 +0200 |
commit | b61176f17b59a94750dff1f959231dadc4e6078a (patch) | |
tree | 88ee419323ba332a1dd06c5aa801c87f59b36bb3 /scan_asn1tagint.c | |
parent | ldadp.h: Add missing SearchRequestReference opcode (diff) | |
download | ldadp-b61176f17b59a94750dff1f959231dadc4e6078a.tar.gz ldadp-b61176f17b59a94750dff1f959231dadc4e6078a.tar.xz ldadp-b61176f17b59a94750dff1f959231dadc4e6078a.zip |
Update ldap/asn1/... files with current tinyldap
Diffstat (limited to 'scan_asn1tagint.c')
-rw-r--r-- | scan_asn1tagint.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scan_asn1tagint.c b/scan_asn1tagint.c index 49a9974..2c23fa2 100644 --- a/scan_asn1tagint.c +++ b/scan_asn1tagint.c @@ -3,9 +3,10 @@ size_t scan_asn1tagint(const char* src,const char* max,unsigned long* val) { const char* orig=src; unsigned long l=0; + if (src==max || (unsigned char)src[0]==0x80) return 0; /* catch non-minimal encoding */ for (;; ++src) { if (src>=max) return 0; - if (l>(((unsigned long)-1)>>7)) return 0; /* catch integer overflow */ + if (l>>(sizeof(l)*8-7)) return 0; /* catch integer overflow */ l=l*128+(*src&0x7F); if (!(*src&0x80)) break; } |