Skip to content

Commit

Permalink
Fix return value.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sjaeckel committed Feb 18, 2025
1 parent 0996354 commit c8391c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pk/asn1/der/general/der_decode_asn1_identifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int der_decode_asn1_identifier(const unsigned char *in, unsigned long *inlen, lt
}
}

return CRYPT_OK;
return err;
}

#endif

0 comments on commit c8391c4

Please sign in to comment.