diff options
author | Colin Watson <cjwatson@debian.org> | 2017-10-04 11:23:58 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-10-05 23:58:12 +0100 |
commit | 0556ea972b15607b7e13ff31bc05840881c91dd3 (patch) | |
tree | d6b8d48062d0278b5ae0eeff42d0e9afa9f26860 /utf8.c | |
parent | db2122d97eb1ecdd8d99b7bf79b0dd2b5addfd92 (diff) | |
parent | 801a62eedaaf47b20dbf4b426dc3e084bf0c8d49 (diff) |
New upstream release (7.6p1)
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: utf8.c,v 1.5 2017/02/19 00:10:57 djm Exp $ */ | 1 | /* $OpenBSD: utf8.c,v 1.7 2017/05/31 09:15:42 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> | 3 | * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> |
4 | * | 4 | * |
@@ -61,7 +61,8 @@ dangerous_locale(void) { | |||
61 | 61 | ||
62 | loc = nl_langinfo(CODESET); | 62 | loc = nl_langinfo(CODESET); |
63 | return strcmp(loc, "US-ASCII") != 0 && strcmp(loc, "UTF-8") != 0 && | 63 | return strcmp(loc, "US-ASCII") != 0 && strcmp(loc, "UTF-8") != 0 && |
64 | strcmp(loc, "ANSI_X3.4-1968") != 0 && strcmp(loc, "646") != 0; | 64 | strcmp(loc, "ANSI_X3.4-1968") != 0 && strcmp(loc, "646") != 0 && |
65 | strcmp(loc, "") != 0; | ||
65 | } | 66 | } |
66 | 67 | ||
67 | static int | 68 | static int |
@@ -75,7 +76,7 @@ grow_dst(char **dst, size_t *sz, size_t maxsz, char **dp, size_t need) | |||
75 | tsz = *sz + 128; | 76 | tsz = *sz + 128; |
76 | if (tsz > maxsz) | 77 | if (tsz > maxsz) |
77 | tsz = maxsz; | 78 | tsz = maxsz; |
78 | if ((tp = realloc(*dst, tsz)) == NULL) | 79 | if ((tp = recallocarray(*dst, *sz, tsz, 1)) == NULL) |
79 | return -1; | 80 | return -1; |
80 | *dp = tp + (*dp - *dst); | 81 | *dp = tp + (*dp - *dst); |
81 | *dst = tp; | 82 | *dst = tp; |