pkgsrc-wip/dwb-gtk3-git/patches/patch-src_util_mktlds-header.c

17 lines
609 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$NetBSD: patch-src_util_mktlds-header.c,v 1.1 2015/09/01 23:24:56 f8l Exp $
Fixes char overflow bug causing undefined behaviour.
Its apparent when compiling with GCC 4.5 with -O2, for example.
--- src/util/mktlds-header.c.orig 2014-03-07 11:39:43.000000000 +0000
+++ src/util/mktlds-header.c
@@ -198,7 +198,7 @@ int main()
if (fgets(buf, sizeof(buf), stdin) == NULL)
break;
- for (ptr = buf+strlen(buf)-1; isspace(*ptr) ||
+ for (ptr = buf+strlen(buf)-1; isspace((unsigned char)*ptr) ||
*ptr == '\n' || *ptr == '\r'; ptr --)
*ptr = '\0';