You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bneradt (via GitHub)" <gi...@apache.org> on 2023/08/18 03:04:30 UTC

[GitHub] [trafficserver] bneradt commented on a diff in pull request #10212: Coverity 1518060: Uninitialized scalar variable

bneradt commented on code in PR #10212:
URL: https://github.com/apache/trafficserver/pull/10212#discussion_r1297936773


##########
iocore/net/UnixUDPNet.cc:
##########
@@ -1014,8 +1014,8 @@ bool
 UDPNetProcessor::CreateUDPSocket(int *resfd, sockaddr const *remote_addr, Action **status, NetVCOptions const &opt)
 {
   int res = 0, fd = -1;
-  int local_addr_len;
   IpEndpoint local_addr;
+  int local_addr_len = sizeof(local_addr.sa);

Review Comment:
   Am I reading this right that this is only used as a throw-away, non-read output variable below? If so, I suggest just declaring and initializing it to zero just before the point of use.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org