diff options
author | Oto Šťáva <oto.stava@nic.cz> | 2024-05-14 12:05:01 +0200 |
---|---|---|
committer | Oto Šťáva <oto.stava@nic.cz> | 2024-05-14 12:05:01 +0200 |
commit | 2905edac512ebe123fc445e8f20e3bc82ce6c9df (patch) | |
tree | 8538f086c902b1e975607a2ec49f4a11a246cb09 /daemon/bindings | |
parent | Merge branch 'knot_wire-6.0' into '6.0' (diff) | |
parent | .gitlab-ci: remove SonarCloud Scanner (diff) | |
download | knot-resolver-2905edac512ebe123fc445e8f20e3bc82ce6c9df.tar.xz knot-resolver-2905edac512ebe123fc445e8f20e3bc82ce6c9df.zip |
Merge 'origin/master' into 6.0 - last merge before rename
This is the last commit in `6.0` before it is shifted into `master`,
with 5.x support being moved to `master-5`.
Diffstat (limited to 'daemon/bindings')
-rw-r--r-- | daemon/bindings/net.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/daemon/bindings/net.c b/daemon/bindings/net.c index d278ed17..aaeef238 100644 --- a/daemon/bindings/net.c +++ b/daemon/bindings/net.c @@ -468,7 +468,7 @@ static int net_interfaces(lua_State *L) /* Hardware address. */ char *p = buf; for (int k = 0; k < sizeof(iface.phys_addr); ++k) { - sprintf(p, "%.2x:", (uint8_t)iface.phys_addr[k]); + (void)sprintf(p, "%.2x:", (uint8_t)iface.phys_addr[k]); p += 3; } p[-1] = '\0'; @@ -788,7 +788,7 @@ static int net_tls_client(lua_State *L) /* Sort the strings for easier comparison later. */ if (newcfg->ca_files.len) { qsort(&newcfg->ca_files.at[0], newcfg->ca_files.len, - sizeof(newcfg->ca_files.at[0]), strcmp_p); + array_member_size(newcfg->ca_files), strcmp_p); } } lua_pop(L, 1); @@ -828,7 +828,7 @@ static int net_tls_client(lua_State *L) /* Sort the raw strings for easier comparison later. */ if (newcfg->pins.len) { qsort(&newcfg->pins.at[0], newcfg->pins.len, - sizeof(newcfg->pins.at[0]), cmp_sha256); + array_member_size(newcfg->pins), cmp_sha256); } } lua_pop(L, 1); @@ -1031,7 +1031,11 @@ static int net_tls_sticket_secret_file(lua_State *L) STR(net_tls_sticket_MIN_SECRET_LEN) " bytes", file_name); } - fclose(fp); + if (fclose(fp) == EOF) { + lua_error_p(L, + "net.tls_sticket_secret_file - reading of file '%s' failed", + file_name); + } tls_session_ticket_ctx_destroy(the_network->tls_session_ticket_ctx); the_network->tls_session_ticket_ctx = |