Skip to content
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

Fix more mostly benign Linux/GCC compiler warnings #827

Merged
merged 1 commit into from Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/probe_modules/module_dns.c
Expand Up @@ -634,7 +634,7 @@ static int dns_global_initialize(struct state_conf *conf)
uint domain_len = strlen(domain_token);
// add space for the null terminator
char* domain_ptr = xmalloc(domain_len + 1);
strncpy(domain_ptr, domain_token, domain_len);
strncpy(domain_ptr, domain_token, domain_len + 1);
// add null terminator
domain_ptr[domain_len] = '\0';

Expand Down
3 changes: 3 additions & 0 deletions src/send-linux.c
Expand Up @@ -36,6 +36,9 @@
#include "./send-linux.h"
#include "state.h"

// Dummy sockaddr for sendto
static struct sockaddr_ll sockaddr;

int send_run_init(sock_t s)
{
// Get the actual socket
Expand Down
3 changes: 0 additions & 3 deletions src/send-linux.h
Expand Up @@ -21,7 +21,4 @@
#include "../lib/includes.h"


// Dummy sockaddr for sendto
static struct sockaddr_ll sockaddr;

#endif /* ZMAP_SEND_LINUX_H */
2 changes: 1 addition & 1 deletion src/send.c
Expand Up @@ -278,6 +278,7 @@ int send_run(sock_t st, shard_t *s)
last_time = steady_now();
}
}
int attempts = zconf.retries + 1;
// Get the initial IP to scan.
target_t current = shard_get_cur_target(s);
uint32_t current_ip = current.ip;
Expand All @@ -300,7 +301,6 @@ int send_run(sock_t st, shard_t *s)
}
}
}
int attempts = zconf.retries + 1;
while (1) {
// Adaptive timing delay
if (count && delay > 0) {
Expand Down