audit_logging: Use `json_int_t` instead of `int` for `json_add_int` value type
authorLi Yuxuan <liyuxuan.darfux@bytedance.com>
Thu, 9 Mar 2023 03:11:28 +0000 (11:11 +0800)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 Mar 2023 21:33:43 +0000 (21:33 +0000)
commit78635d55fb819d422d0c4c32bb63aab95f735e4b
treea6dcf901e402ff45be29d57ed76f622f910c4b3c
parent35aa7db641484b33ff55a7d8fe2d21c6b411f847
audit_logging: Use `json_int_t` instead of `int` for `json_add_int` value type

Functions like `add_lock_to_json` and `add_profile_item_to_json` pass
some values to `json_add_int` with `intmax_t` types. This may cause
arithmetic overflow when the value grows very fast, such as the
read_bytes profiling data.
Use `json_add_int` instead of `int` to avoid the overflow.

RN: Make json output show intmax_t value properly

Signed-off-by: Li Yuxuan <liyuxuan.darfux@bytedance.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Mar  9 21:33:43 UTC 2023 on atb-devel-224
lib/audit_logging/audit_logging.c
lib/audit_logging/audit_logging.h
selftest/knownfail.d/json_add_int [deleted file]