PVS V507: pointer to stack leaked to global variable

Change-Id: I56740f4b847c0b99a44e7db830bcccb20bf51cbc
Reviewed-on: https://review.haiku-os.org/c/1601
Reviewed-by: Stephan Aßmus <[email protected]>
This commit is contained in:
Adrien Destugues
2019-07-16 20:36:48 +00:00
committed by Stephan Aßmus
parent 1ec8732c71
commit a6dcaa68a9
+5
View File
@@ -1302,6 +1302,11 @@ pinger()
i = sendmsg(s, &smsghdr, 0);
// as smsghdr is a global variable, don't let stray pointer to the stack
// in it after this function returns.
smsghdr.msg_iov = NULL;
smsghdr.msg_iovlen = 0;
if (i < 0 || i != cc) {
if (i < 0)
warn("sendmsg");