Fix zero stripping in %g number formatting.

Reported by pwnhacker0x18. #1149
This commit is contained in:
Mike Pall 2024-01-25 13:23:48 +01:00
parent f2336c48fa
commit 343ce0edaf

View File

@ -454,7 +454,8 @@ static char *lj_strfmt_wfnum(SBuf *sb, SFormat sf, lua_Number n, char *p)
prec--;
if (!i) {
if (ndlo == ndhi) { prec = 0; break; }
lj_strfmt_wuint9(tail, nd[++ndlo]);
ndlo = (ndlo + 1) & 0x3f;
lj_strfmt_wuint9(tail, nd[ndlo]);
i = 9;
}
}