Skip to content
Snippets Groups Projects
Commit a8cc886c authored by Arne Goedeke's avatar Arne Goedeke
Browse files

sprintf: update the local stack top pointer

When a call to low_pike_sprintf reallocates the format stack during
snurkel handling, the local stack pointer variable becomes invalid.
Update it after handling snurkels.
parent f06806a5
Branches
Tags
No related merge requests found
......@@ -1104,6 +1104,7 @@ static void low_pike_sprintf(struct format_stack *fs,
Pike_sp++;
low_pike_sprintf(fs, &_b,begin,SUBTRACT_PCHARP(a,begin)+1,
Pike_sp-1,1,nosnurkel+1, compat_mode);
fsp = fs->fsp;
if(save_sp < Pike_sp) pop_stack();
}
fsp->b=MKPCHARP_STR(_b.s);
......@@ -1361,6 +1362,7 @@ cont_2:
}
low_pike_sprintf(fs, &b,ADD_PCHARP(a,1),e-2,s,Pike_sp-s,0,
compat_mode);
fsp = fs->fsp;
pop_n_elems(Pike_sp-s);
}
#ifdef PIKE_DEBUG
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment