]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/varlink.c
shared/varlink: add missing terminator in json strings
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 May 2019 16:35:22 +0000 (18:35 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 May 2019 16:45:06 +0000 (18:45 +0200)
commit2a04712c19556517b47215d49b3faea14490a4f3
tree790bfa2470bc1c74d52f90640357d7bb4469daae
parentc2babfc2f5240019ca09a9c2ef026755b997adb4
shared/varlink: add missing terminator in json strings

Should finally fix oss-fuzz-14688.
8688c29b5aece49805a244676cba5bba0196f509 wasn't enough.

The buffer retrieved from memstream has the size that the same as the written
data. When we write do write(f, s, strlen(s)), then no terminating NUL is written,
and the buffer is not (necessarilly) a proper C string.
src/shared/json.c
src/shared/varlink.c
src/test/test-json.c