ext: Return NULL from get_label() when no label is present

This commit is contained in:
mintsuki 2022-07-07 11:22:43 +02:00
parent eafff620d7
commit 7895c6827c
1 changed files with 3 additions and 0 deletions

View File

@ -638,6 +638,9 @@ char *ext2_get_label(struct volume *part) {
}
size_t label_len = strlen((char *)sb.s_volume_name);
if (label_len == 0) {
return NULL;
}
char *ret = ext_mem_alloc(label_len + 1);
strcpy(ret, (char *)sb.s_volume_name);