diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-07-09 10:19:18 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-07-09 10:19:18 -0600 |
commit | 6081f1b5740a1b56446eee44c8267a6bce870ac0 (patch) | |
tree | c73bf1990bb67e35cecdfffa50a2e64b8a6566a4 /pith/filter.c | |
parent | 823e9e04ffcbd767f1ed3ab6ccc907ba86e23d25 (diff) | |
download | alpine-6081f1b5740a1b56446eee44c8267a6bce870ac0.tar.xz |
* Crash in PC-Alpine when using the eXternal command.
Diffstat (limited to 'pith/filter.c')
-rw-r--r-- | pith/filter.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pith/filter.c b/pith/filter.c index 13ee459e..22f98ad7 100644 --- a/pith/filter.c +++ b/pith/filter.c @@ -9063,21 +9063,23 @@ cid_tempfile_name(char *line, long n, int *is_cidp) { int f2 = 0; int i, found; - char *s, *t = NULL, *u; + char *s, *t = NULL, *u, c; char imgfile[1024]; char *extp = NULL; - + c = line[n]; + line[n] = '\0'; s = NULL; *is_cidp = 0; if(n > 0){ - if (line[0] == '\"') f2 = 1; + if (line[0] == '\"') + f2 = 1; if (n - f2 > 3){ if (!struncmp(line+f2, "cid:", 4)){ *is_cidp = 1; f2 += 4; s = fs_get((n - f2 + 4)*sizeof(char)); - snprintf(s, n - f2 + 2, "<%s", line+f2); + sprintf(s, "<%s", line+f2); if (s[strlen(s)-1] == '\"') s[strlen(s)-1] = '>'; else{ @@ -9120,6 +9122,7 @@ cid_tempfile_name(char *line, long n, int *is_cidp) } } } + line[n] = c; return s; } |