[lxc-devel] [lxc/lxc] 949665: confile: improve strprint()
GitHub
noreply at github.com
Wed May 30 15:35:36 UTC 2018
Branch: refs/heads/master
Home: https://github.com/lxc/lxc
Commit: 9496659c6b167951d0e1ae4109a9d08da0d1b31a
https://github.com/lxc/lxc/commit/9496659c6b167951d0e1ae4109a9d08da0d1b31a
Author: Christian Brauner <christian.brauner at ubuntu.com>
Date: 2018-05-30 (Wed, 30 May 2018)
Changed paths:
M src/lxc/confile_utils.h
Log Message:
-----------
confile: improve strprint()
POSIX specifies [1]:
"If the value of n is zero on a call to snprintf(), nothing shall be written,
the number of bytes that would have been written had n been sufficiently large
excluding the terminating null shall be returned, and s may be a null pointer."
But in case there are any non-sane libcs out there that do actually dereference
the buffer when when 0 is passed as length to snprintf() let's give them a
dummy buffer.
[1]: The Open Group Base Specifications Issue 7, 2018 edition
IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
Copyright © 2001-2018 IEEE and The Open Group
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
Reported-by: Donghwa Jeong <dh48.jeong at samsung.com>
Commit: ed40d791c4f1aba4008c3127161f9c515123919c
https://github.com/lxc/lxc/commit/ed40d791c4f1aba4008c3127161f9c515123919c
Author: Stéphane Graber <stgraber at stgraber.org>
Date: 2018-05-30 (Wed, 30 May 2018)
Changed paths:
M src/lxc/confile_utils.h
Log Message:
-----------
Merge pull request #2365 from brauner/2018-05-30/improve_strprint
confile: improve strprint()
Compare: https://github.com/lxc/lxc/compare/9715e65c41dc...ed40d791c4f1
**NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
Functionality will be removed from GitHub.com on January 31st, 2019.
More information about the lxc-devel
mailing list