File:  [cvs.NetBSD.org] / pkgsrc / sysutils / arm-trusted-firmware-fiptool / patches / Attic / patch-fiptool_uuid_parse
Revision 1.1: download - view: text, annotated - select for diffs
Tue May 14 04:08:51 2019 UTC (5 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, HEAD
Pluck the following patch from upstream:

tools/fiptool: Fix UUID parsing in blob handling
Commit 0336486 ("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>

$NetBSD: patch-fiptool_uuid_parse,v 1.1 2019/05/14 04:08:51 thorpej Exp $

Patch from upstream to fix UUID parsing bug in --blob handling.

--- fiptool.c.orig	2019-05-14 04:51:36.000000000 +0000
+++ fiptool.c
@@ -271,10 +271,10 @@ static void uuid_from_str(uuid_t *u, con
 	    &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);
 }
 

CVSweb <webmaster@jp.NetBSD.org>