aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/file.c b/file.c
index e82eaf1..18b350a 100644
--- a/file.c
+++ b/file.c
@@ -4361,8 +4361,9 @@ getMetaRefreshParam(char *q, Str *refresh_uri)
r++;
s_tmp = Strnew_charp_n(q, r - q);
- if (s_tmp->ptr[s_tmp->length - 1] == '\"' /* " */
- || s_tmp->ptr[s_tmp->length - 1] == '\'') { /* ' */
+ if (s_tmp->length > 0 &&
+ (s_tmp->ptr[s_tmp->length - 1] == '\"' || /* " */
+ s_tmp->ptr[s_tmp->length - 1] == '\'')) { /* ' */
s_tmp->length--;
s_tmp->ptr[s_tmp->length] = '\0';
}