]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: iso9660: check that iso->publisher_id and iso->application_id are not file...
authorPali Rohár <pali.rohar@gmail.com>
Tue, 8 Dec 2020 23:36:13 +0000 (00:36 +0100)
committerPali Rohár <pali.rohar@gmail.com>
Tue, 8 Dec 2020 23:36:13 +0000 (00:36 +0100)
ECMA 119 (ISO 9660) says that if the first byte is set to (5F), the
remaining bytes of this field shall specify an identifier for a file
containing the data. As libblkid does not support reading files from the
filesystem itself it cannot parse fields which starts with 0x5F '_' char.

So for now ignore iso->publisher_id and iso->application_id values which
starts with '_' character.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
libblkid/src/superblocks/iso9660.c

index 9cfbc0dfecb8d53d72841bbfd6cfb6aa6ca9fad3..c9226e4358893233dac41eb492957652e6985960 100644 (file)
@@ -193,11 +193,11 @@ static int probe_iso9660(blkid_probe pr, const struct blkid_idmag *mag)
        blkid_probe_set_id_label(pr, "SYSTEM_ID",
                                iso->system_id, sizeof(iso->system_id));
 
-       if (!is_str_empty(iso->publisher_id, sizeof(iso->publisher_id)))
+       if (!is_str_empty(iso->publisher_id, sizeof(iso->publisher_id)) && iso->publisher_id[0] != '_')
                blkid_probe_set_id_label(pr, "PUBLISHER_ID",
                                iso->publisher_id, sizeof(iso->publisher_id));
 
-       if (!is_str_empty(iso->application_id, sizeof(iso->application_id)))
+       if (!is_str_empty(iso->application_id, sizeof(iso->application_id)) && iso->application_id[0] != '_')
                blkid_probe_set_id_label(pr, "APPLICATION_ID",
                                iso->application_id, sizeof(iso->application_id));