fix crash with null arithmetic for expression; fix size_t issue with history search string allocation

This commit is contained in:
Chet Ramey
2023-03-02 12:04:03 -05:00
parent 349e21043e
commit 0bd0fb5966
5 changed files with 54 additions and 7 deletions
+1 -1
View File
@@ -2994,7 +2994,7 @@ eval_arith_for_expr (WORD_LIST *l, int *okp)
temp = expand_arith_string (expr, Q_DOUBLE_QUOTES|Q_ARITH);
if (l->next)
free (expr);
new = make_word_list (make_word (temp), (WORD_LIST *)NULL);
new = make_word_list (make_word (temp ? temp : ""), (WORD_LIST *)NULL);
free (temp);
if (new)