left shift of signed long is undefined behavior, it turns out.

don't do it then.
This commit is contained in:
leitner
2023-09-16 19:23:56 +00:00
parent f4d4fb5f1f
commit 3aae498dd3

View File

@@ -30,7 +30,7 @@ size_t scan_asn1rawint(const char* src,const char* max,size_t len,long* l) {
if (len>sizeof(m))
return 0; // value too large, does not fit
for (i=0; i<len; ++i) {
m=(m<<8)|(unsigned char)s[i];
m=((unsigned long)m<<8)|(unsigned char)s[i];
}
*l=m;
return len;