-
Notifications
You must be signed in to change notification settings - Fork 409
SAST checks #2258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
SAST checks #2258
Conversation
After having been compared to a NULL value, pointer 'scur->protocol' is dereferenced by calling function 'strcat'. Make return if getservbyname return 0, so we won't reach the strcpy call. Signed-off-by: smarchenkov <[email protected]>
Pointer 'packet' is passed to a free function at seap-packet.c:51 by passing as 1st parameter to function 'SEAP_packet_free' at seap.c:220 after the referenced memory was deallocated at seap-packet.c:51 by passing as 1st parameter to function 'SEAP_packet_free' at seap.c:220. Note: the second deallocation is on another loop iteration. Signed-off-by: smarchenkov <[email protected]>
Check for NULL pointer 'fp' returned from function 'fopen' Signed-off-by: smarchenkov <[email protected]>
Signed-off-by: smarchenkov <[email protected]>
{ | ||
free(packet); | ||
if (packet != NULL) { | ||
free(packet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
fp = fopen("/proc/net/ipv6_route", "r"); | ||
if (fp == NULL) { | ||
if (errno == ENOENT) { | ||
dI("/proc/net/route does not exist. No IPv4 routing table available."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPv6.
if (service == NULL) { | ||
return -1; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline.
dD("port not set, trying to guess from /etc/services for %s", scur->name); | ||
if (service != NULL) { | ||
if (service == NULL) { | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this change is breaking the logic of the probe. Test is failing.
if (service == NULL) { | ||
return -1; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline.
A few fixes for #2257