projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Call of memcmp with null pointers in obj_cmp()
[openssl.git]
/
crypto
/
objects
/
obj_dat.c
diff --git
a/crypto/objects/obj_dat.c
b/crypto/objects/obj_dat.c
index e42a1c147de8e8bfd9fc2834e244ea4762b226ae..5ff1294d3c45f26063b7a47d6783c897dca76e3a 100644
(file)
--- a/
crypto/objects/obj_dat.c
+++ b/
crypto/objects/obj_dat.c
@@
-142,7
+142,7
@@
static unsigned long added_obj_hash(const ADDED_OBJ *ca)
return 0;
}
ret &= 0x3fffffffL;
- ret |=
ca->type
<< 30L;
+ ret |=
((unsigned long)ca->type)
<< 30L;
return (ret);
}
@@
-400,6
+400,8
@@
static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
j = (a->length - b->length);
if (j)
return (j);
+ if (a->length == 0)
+ return 0;
return (memcmp(a->data, b->data, a->length));
}