diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-05-06 12:24:45 +0000 | 
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-05-06 12:24:45 +0000 | 
| commit | 20adc8f2a99cd37b64a80ef63dfc5ba6627d4dfb (patch) | |
| tree | ad57ce9ac9538c780c802adbdfc4c581f9100310 /utf8.c | |
| parent | 343d57711556d429eda777ab259ff924acbd6b34 (diff) | |
Diffstat (limited to 'utf8.c')
| -rw-r--r-- | utf8.c | 7 | 
1 files changed, 4 insertions, 3 deletions
| @@ -1,4 +1,4 @@ -/* $OpenBSD: utf8.c,v 1.5 2017/02/19 00:10:57 djm Exp $ */ +/* $OpenBSD: utf8.c,v 1.7 2017/05/31 09:15:42 deraadt Exp $ */  /*   * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>   * @@ -61,7 +61,8 @@ dangerous_locale(void) {  	loc = nl_langinfo(CODESET);  	return strcmp(loc, "US-ASCII") != 0 && strcmp(loc, "UTF-8") != 0 && -	    strcmp(loc, "ANSI_X3.4-1968") != 0 && strcmp(loc, "646") != 0; +	    strcmp(loc, "ANSI_X3.4-1968") != 0 && strcmp(loc, "646") != 0 && +	    strcmp(loc, "") != 0;  }  static int @@ -75,7 +76,7 @@ grow_dst(char **dst, size_t *sz, size_t maxsz, char **dp, size_t need)  	tsz = *sz + 128;  	if (tsz > maxsz)  		tsz = maxsz; -	if ((tp = realloc(*dst, tsz)) == NULL) +	if ((tp = recallocarray(*dst, *sz, tsz, 1)) == NULL)  		return -1;  	*dp = tp + (*dp - *dst);  	*dst = tp; | 
