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 9efd9deb37
commit 9dce9c7bb3

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);