Commit dc3312c4 authored by Richard Genoud's avatar Richard Genoud Committed by Tom Rini
Browse files

fs/squashfs: sqfs_concat_tokens: check if malloc succeeds



memory allocation should always be checked
Reviewed-by: default avatarJoao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: default avatarRichard Genoud <richard.genoud@posteo.net>
parent 4c83d275
...@@ -242,6 +242,9 @@ static char *sqfs_concat_tokens(char **token_list, int token_count) ...@@ -242,6 +242,9 @@ static char *sqfs_concat_tokens(char **token_list, int token_count)
length = sqfs_get_tokens_length(token_list, token_count); length = sqfs_get_tokens_length(token_list, token_count);
result = malloc(length + 1); result = malloc(length + 1);
if (!result)
return NULL;
result[length] = '\0'; result[length] = '\0';
for (i = 0; i < token_count; i++) { for (i = 0; i < token_count; i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment