diff options
author | Steve Bennett <steveb@workware.net.au> | 2017-05-26 14:22:48 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2017-05-26 14:27:57 +1000 |
commit | 0858783cc469c095d7e6121d1fc5689760da841e (patch) | |
tree | 0d249bf186591772b5bcabde5b25832e6c7c1ba9 /jim.c | |
parent | bd5139c89e714bb7e10a0da55d9a10f51e93516c (diff) | |
download | jimtcl-0858783cc469c095d7e6121d1fc5689760da841e.zip jimtcl-0858783cc469c095d7e6121d1fc5689760da841e.tar.gz jimtcl-0858783cc469c095d7e6121d1fc5689760da841e.tar.bz2 |
scan: validate -ve XPG3 specifier
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim.c')
-rw-r--r-- | jim.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -9516,6 +9516,11 @@ static int SetScanFmtFromAny(Jim_Interp *interp, Jim_Obj *objPtr) return JIM_ERR; } } + if (descr->pos < 0) { + fmtObj->error = + "\"%n$\" conversion specifier is negative"; + return JIM_ERR; + } /* Try to find a width after the XPG3 specifier */ if (sscanf(fmt, "%d%n", &width, &skip) == 1) { descr->width = width; |