commit 5acf19ec96258db04cb04a15bb769cefc9e923f5 from: Thomas Adam date: Sat Jun 22 11:56:50 2024 UTC 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. commit - d37f75805ed5a94e42378dc8f3b60055be71054a commit + 5acf19ec96258db04cb04a15bb769cefc9e923f5 blob - 6ab87f7d5f8bef6b9ef9af1c4c50843bab97409e blob + b2b5b6e785c3cd9571421ece363546fa3fcff6e9 --- 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);