projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07bed46
)
Check for errors in a2d_ASN1_OBJECT()
author
Dr. Stephen Henson
<steve@openssl.org>
Fri, 5 Aug 2016 13:33:03 +0000
(14:33 +0100)
committer
Dr. Stephen Henson
<steve@openssl.org>
Mon, 15 Aug 2016 23:19:19 +0000
(
00:19
+0100)
Check for error return in BN_div_word().
Reviewed-by: Tim Hudson <tjh@openssl.org>
crypto/asn1/a_object.c
patch
|
blob
|
history
diff --git
a/crypto/asn1/a_object.c
b/crypto/asn1/a_object.c
index 6fc7681c235b07731d1fb5217e2a2a9b2299ad74..79f0ecd2a868405f79d6561fa412e42362023d0c 100644
(file)
--- a/
crypto/asn1/a_object.c
+++ b/
crypto/asn1/a_object.c
@@
-127,8
+127,12
@@
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
if (tmp == NULL)
goto err;
}
- while (blsize--)
- tmp[i++] = (unsigned char)BN_div_word(bl, 0x80L);
+ while (blsize--) {
+ BN_ULONG t = BN_div_word(bl, 0x80L);
+ if (t == (BN_ULONG)-1)
+ goto err;
+ tmp[i++] = (unsigned char)t;
+ }
} else {
for (;;) {