Commit Diff
- Commit:
5acf19ec96258db04cb04a15bb769cefc9e923f5
- From:
- Thomas Adam <thomas.adam22@gmail.com>
- Date:
- Message:
- mailcap: reset string parser state for cmd handling When interpolating a mailcap command, make sure we reset the state of the string parser each time, otherwise the intended command is never interpolated. This would mean that previous commands would get run with old files, or worse still, segfault.
- Actions:
- Patch | Tree
--- mailcap.c +++ mailcap.c @@ -223,6 +223,7 @@ str_to_argv(char *str, int *ret_argc, char ***ret_argv return -1; free(sps.buf); + memset(&sps, 0, sizeof(sps)); sps.buf = xstrdup(str); sps.len = strlen(sps.buf);