tools/fiptool: Fix UUID parsing in blob handling
authorAndre Przywara <andre.przywara@arm.com>
Tue, 29 Jan 2019 09:25:14 +0000 (09:25 +0000)
committerAndre Przywara <andre.przywara@arm.com>
Tue, 29 Jan 2019 09:25:14 +0000 (09:25 +0000)
Commit 033648652f ("Make TF UUID RFC 4122 compliant") changed the scanf
parsing string to handle endianness correctly.
However that changed the number of items sscanf handles, without
adjusting the sanity check just below.

Increase the expected return value from 11 to 16 to let fiptool handle
UUIDs given as blob parameters correctly again.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
tools/fiptool/fiptool.c

index 0d4f929bb582d25d68c9f923f0c57d65bad7529a..80b498e47eb9a807c3e7375d140e7e10e92e5553 100644 (file)
@@ -271,10 +271,10 @@ static void uuid_from_str(uuid_t *u, const char *s)
            &u->node[2], &u->node[3],
            &u->node[4], &u->node[5]);
        /*
-        * Given the format specifier above, we expect 11 items to be scanned
+        * Given the format specifier above, we expect 16 items to be scanned
         * for a properly formatted UUID.
         */
-       if (n != 11)
+       if (n != 16)
                log_errx("Invalid UUID: %s", s);
 }