Security review (#331)
* Fix some issues * add typed_data.c changes * Make attribution after the check
This commit is contained in:
@@ -74,6 +74,11 @@ void *encode_uint(const uint8_t *const value, uint8_t length) {
|
||||
void *encode_int(const uint8_t *const value, uint8_t length, uint8_t typesize) {
|
||||
uint8_t padding_value;
|
||||
|
||||
if (length < 1) {
|
||||
apdu_response_code = APDU_RESPONSE_INVALID_DATA;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((length == typesize) && (value[0] & (1 << 7))) // negative number
|
||||
{
|
||||
padding_value = 0xFF;
|
||||
|
||||
Reference in New Issue
Block a user