diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-01-20 19:59:46 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-01-20 19:59:46 +0100 |
commit | 01132db357544327e4934c2b1a5255cd8b2a7c1e (patch) | |
tree | bbff99af205ce17c443485fb81433d9834785218 /lib.c | |
parent | 03b6a8efc1834a4114f0d11e1a7cecff3242b305 (diff) |
lib: fix %J string formats with precision specifier
Previous refactoring of the code led to an invalid internal format pettern
being used to output the formatted JSON data.
Fixes: 9041e24 ("lib: fix uninitialized memory access on handling %J string formats")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1324,8 +1324,9 @@ uc_printf_common(uc_vm_t *vm, size_t nargs, uc_stringbuf_t *buf) if (sfmt[i] == '.') { for (pad_size = 0, i++; sfmt + i < fp && isdigit(sfmt[i]); i++) pad_size = pad_size * 10 + (sfmt[i] - '0'); + pad_size++; - fp = &sfmt[i-1]; + fp = strchr(sfmt, '.'); break; } } |