Do not assume that int is of the same size as size_t. Close #3614

This commit is contained in:
nnposter 2026-11-17 22:20:49 +00:00
parent 7d19be12f3
commit 394da47a0a
2 changed files with 5 additions and 3 deletions

View file

@ -72,8 +72,8 @@ extern NpingOps o;
int atoIP(const char *hostname, struct in_addr *dst){
struct sockaddr_in i;
unsigned int stlen=0;
if ( resolve(hostname, 0, (sockaddr_storage*)&i, (size_t *)&stlen , PF_INET) != 0 )
size_t stlen=0;
if ( resolve(hostname, 0, (sockaddr_storage*)&i, &stlen , PF_INET) != 0 )
return OP_FAILURE;
*dst=i.sin_addr;
return OP_SUCCESS;

View file

@ -625,6 +625,7 @@ static int lzstream_lines(lua_State *L) {
static int lzstream_docompress(lua_State *L, lz_stream *s, int from, int to, int flush) {
int r, arg;
int self = 0;
size_t avail_in;
size_t b_size = s->o_buffer_max;
unsigned char *b = (unsigned char *)s->o_buffer;
@ -636,7 +637,8 @@ static int lzstream_docompress(lua_State *L, lz_stream *s, int from, int to, int
}
for (arg = from; arg <= to; arg++) {
s->zstream.next_in = (unsigned char*)luaL_checklstring(L, arg, (size_t*)&s->zstream.avail_in);
s->zstream.next_in = (unsigned char*)luaL_checklstring(L, arg, &avail_in);
s->zstream.avail_in = avail_in;
do {
s->zstream.next_out = b;