Skip to content

Commit c8391c4

Browse files
committed
Fix return value.
Instead of wrongfully always returning OK, return the real error code. This was uncovered by the amalgamation via the warning: ``` pre_gen/tomcrypt_amalgam.c: In function ‘der_decode_custom_type_ex’: pre_gen/tomcrypt_amalgam.c:49820:10: warning: ‘*(unsigned int *)((char *)&ident + offsetof(ltc_asn1_list, type))’ may be used uninitialized [-Wmaybe-uninitialized] 49820 | if ((ident.type != root->type) || | ^ pre_gen/tomcrypt_amalgam.c:49780:18: note: ‘*(unsigned int *)((char *)&ident + offsetof(ltc_asn1_list, type))’ was declared here 49780 | ltc_asn1_list ident; | ^~~~~ ``` Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 0996354 commit c8391c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pk/asn1/der/general/der_decode_asn1_identifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int der_decode_asn1_identifier(const unsigned char *in, unsigned long *inlen, lt
117117
}
118118
}
119119

120-
return CRYPT_OK;
120+
return err;
121121
}
122122

123123
#endif

0 commit comments

Comments
 (0)