mirror of https://github.com/irungentoo/toxcore
fix: Fix some false positive from PVS Studio.
It correctly warns about potentially dereferencing NULL chat in a log statement. However, chat can semantically never be NULL in that call, and it's just a defensive check. Still good to fix for clarity.pull/1660/head
parent
7c44379ccb
commit
9fe18b176f
|
@ -18,4 +18,4 @@ if [ -f "$DOCKERDIR/dockerignore" ]; then
|
|||
cat "$DOCKERDIR/dockerignore" >>"$DOCKERDIR/$BUILD.Dockerfile.dockerignore"
|
||||
fi
|
||||
|
||||
docker build -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .
|
||||
docker build "${DOCKERFLAGS[@]}" -t "toxchat/c-toxcore:$BUILD" -f "other/docker/$BUILD/$BUILD.Dockerfile" .
|
||||
|
|
|
@ -5560,12 +5560,12 @@ static int make_gc_handshake_packet(const GC_Chat *chat, const GC_Connection *gc
|
|||
uint8_t request_type, uint8_t join_type, uint8_t *packet, size_t packet_size,
|
||||
const Node_format *node)
|
||||
{
|
||||
if (packet_size != GC_MIN_ENCRYPTED_HS_PAYLOAD_SIZE + sizeof(Node_format)) {
|
||||
LOGGER_FATAL(chat->log, "invalid packet size: %zu", packet_size);
|
||||
if (chat == nullptr || gconn == nullptr || node == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (chat == nullptr || gconn == nullptr || node == nullptr) {
|
||||
if (packet_size != GC_MIN_ENCRYPTED_HS_PAYLOAD_SIZE + sizeof(Node_format)) {
|
||||
LOGGER_FATAL(chat->log, "invalid packet size: %zu", packet_size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue