diff options
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.99 2015/10/24 08:34:09 sthen Exp $ */ +/* $OpenBSD: misc.c,v 1.100 2015/12/04 21:51:06 tobias Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -604,6 +604,8 @@ percent_expand(const char *string, ...) /* %% case */ if (*string == '%') goto append; + if (*string == '\0') + fatal("%s: invalid format", __func__); for (j = 0; j < num_keys; j++) { if (strchr(keys[j].key, *string) != NULL) { i = strlcat(buf, keys[j].repl, sizeof(buf)); |