argp-standalone: fix segfault in canon_doc_option
authorStijn Tintel <stijn@linux-ipv6.be>
Sun, 3 May 2020 17:31:30 +0000 (20:31 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Sun, 3 May 2020 17:31:30 +0000 (20:31 +0300)
Backported from glibc.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
package/libs/argp-standalone/patches/900-fix-segfault-in_canon_doc_option.patch [new file with mode: 0644]

diff --git a/package/libs/argp-standalone/patches/900-fix-segfault-in_canon_doc_option.patch b/package/libs/argp-standalone/patches/900-fix-segfault-in_canon_doc_option.patch
new file mode 100644 (file)
index 0000000..46bffbb
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/argp-help.c
++++ b/argp-help.c
+@@ -777,9 +777,9 @@ hol_entry_cmp (const struct hol_entry *e
+       const char *long2 = hol_entry_first_long (entry2);
+       if (doc1)
+-      doc1 = canon_doc_option (&long1);
++        doc1 = long1 != NULL && canon_doc_option (&long1);
+       if (doc2)
+-      doc2 = canon_doc_option (&long2);
++      doc2 = long2 != NULL && canon_doc_option (&long2);
+       if (doc1 != doc2)
+       /* `documentation' options always follow normal options (or