Fix potential buffer overflow in printf
Printf could potentially produce 2 64 bit numbers here when there is only space for one, thus causing a buffer overflow. This was caught by the new warning flags. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
4e589701d8
commit
dd9e8f6dd0
@ -51,6 +51,7 @@
|
||||
#define PSA_ITS_STORAGE_SUFFIX ".psa_its"
|
||||
#define PSA_ITS_STORAGE_FILENAME_LENGTH \
|
||||
( sizeof( PSA_ITS_STORAGE_PREFIX ) - 1 + /*prefix without terminating 0*/ \
|
||||
16 + /*UID (64-bit number in hex)*/ \
|
||||
16 + /*UID (64-bit number in hex)*/ \
|
||||
sizeof( PSA_ITS_STORAGE_SUFFIX ) - 1 + /*suffix without terminating 0*/ \
|
||||
1 /*terminating null byte*/ )
|
||||
|
@ -16,6 +16,7 @@
|
||||
#define PSA_ITS_STORAGE_SUFFIX ".psa_its"
|
||||
#define PSA_ITS_STORAGE_FILENAME_LENGTH \
|
||||
( sizeof( PSA_ITS_STORAGE_PREFIX ) - 1 + /*prefix without terminating 0*/ \
|
||||
16 + /*UID (64-bit number in hex)*/ \
|
||||
16 + /*UID (64-bit number in hex)*/ \
|
||||
sizeof( PSA_ITS_STORAGE_SUFFIX ) - 1 + /*suffix without terminating 0*/ \
|
||||
1 /*terminating null byte*/ )
|
||||
|
Loading…
Reference in New Issue
Block a user