Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
048fe191
Commit
048fe191
authored
Jul 27, 2021
by
Olivier Deprez
Committed by
TrustedFirmware Code Review
Jul 27, 2021
Browse files
Merge "fix(fdt): fix OOB write in uuid parsing function" into integration
parents
d31f3194
d0d64245
Changes
1
Show whitespace changes
Inline
Side-by-side
common/uuid.c
View file @
048fe191
...
...
@@ -73,6 +73,7 @@ static int read_hex(uint8_t *dest, char *hex_src, unsigned int hex_src_len)
int
read_uuid
(
uint8_t
*
dest
,
char
*
uuid
)
{
int
err
;
uint8_t
*
dest_start
=
dest
;
/* Check that we have enough characters */
if
(
strnlen
(
uuid
,
UUID_STRING_LENGTH
)
!=
UUID_STRING_LENGTH
)
{
...
...
@@ -124,7 +125,7 @@ int read_uuid(uint8_t *dest, char *uuid)
if
(
err
<
0
)
{
WARN
(
"Error parsing UUID
\n
"
);
/* Clear the buffer on error */
memset
((
void
*
)
dest
,
'\0'
,
UUID_BYTES_LENGTH
*
sizeof
(
uint8_t
));
memset
((
void
*
)
dest
_start
,
'\0'
,
UUID_BYTES_LENGTH
*
sizeof
(
uint8_t
));
return
-
EINVAL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment