]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libjail: Handle an error from reallocarray() when trimming the buffer.
authormarkj <markj@FreeBSD.org>
Tue, 7 Jan 2020 21:44:27 +0000 (21:44 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 7 Jan 2020 21:44:27 +0000 (21:44 +0000)
commitaa54f39068f9bae6b0f8a2eea1596e043d056804
tree41e8d9643377cfe76c2a8cec70d6bc2a4c701839
parent33073a3d8c6131681b776795aae3f221bb85bf94
libjail: Handle an error from reallocarray() when trimming the buffer.

There is no API guarantee that realloc() will not fail when the buffer
is shrinking.  Handle it by simply returning the untrimmed buffer.
While this is unlikely to ever happen in practice, it seems worth
handling just to silence static analyzer warnings.

PR: 243106
Submitted by: Hans Christian Woithe <chwoithe@yahoo.com>
MFC after: 1 week
lib/libjail/jail.c