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:
3f640eb
)
Fix error paths in ASN1_TIME_to_generalizedtime
author
Matt Caswell
<matt@openssl.org>
Tue, 21 Mar 2017 09:07:17 +0000
(09:07 +0000)
committer
Matt Caswell
<matt@openssl.org>
Tue, 21 Mar 2017 14:07:50 +0000
(14:07 +0000)
We should not write to |out| in error cases, so we should defer doing this
until the "done" block.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3002)
crypto/asn1/a_time.c
patch
|
blob
|
history
diff --git
a/crypto/asn1/a_time.c
b/crypto/asn1/a_time.c
index 607432581686473fd971c4372b8c66b599a2cafc..0eeb79cd428ce02abac433aaad6126682787f495 100644
(file)
--- a/
crypto/asn1/a_time.c
+++ b/
crypto/asn1/a_time.c
@@
-147,10
+147,9
@@
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
if (!out || !*out) {
if (!(ret = ASN1_GENERALIZEDTIME_new()))
goto err;
- if (out)
- *out = ret;
- } else
+ } else {
ret = *out;
+ }
/* If already GeneralizedTime just copy across */
if (t->type == V_ASN1_GENERALIZEDTIME) {