summaryrefslogtreecommitdiff
path: root/1001-liblangtag-gcc10.patch
blob: 358f887c559f4833be451b4af9f75b7b765f8e15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 49135ef561f309078f0bfd6e1f15052769cf75b4 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Thu, 26 Sep 2019 18:57:32 +0900
Subject: [PATCH] Fix possible null argument for %s directive

Patch from Jeff Law
---
 liblangtag/lt-script-db.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/liblangtag/lt-script-db.c b/liblangtag/lt-script-db.c
index 8278078..bbbd3e7 100644
--- a/liblangtag/lt-script-db.c
+++ b/liblangtag/lt-script-db.c
@@ -133,6 +133,10 @@ lt_script_db_parse(lt_script_db_t  *scriptdb,
 			}
 			cnode = cnode->next;
 		}
+		if (!subtag && !desc) {
+			lt_warning("No subtag and no description");
+			goto bail1;
+		}
 		if (!subtag) {
 			lt_warning("No subtag node: description = '%s'",
 				   desc);
-- 
2.10.5