stricter length check in copy_to_skad()
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-01 10:27:18 +09:00
parent 6aca30c893
commit 00c9983328
2 changed files with 6 additions and 6 deletions

View File

@ -122,8 +122,9 @@ static int prefix_to_in6 (int prefix, struct in6_addr* in6)
static HAWK_INLINE void copy_to_skad (struct sockaddr* sa, hawk_oow_t sa_size, hawk_skad_t* skad) static HAWK_INLINE void copy_to_skad (struct sockaddr* sa, hawk_oow_t sa_size, hawk_skad_t* skad)
{ {
/* assume *skad is large enough */ hawk_oow_t len;
HAWK_MEMCPY(skad, sa, sa_size); len = (sa_size <= HAWK_SIZEOF(*skad))? sa_size: HAWK_SIZEOF(*skad);
HAWK_MEMCPY(skad, sa, len);
} }
/* /*

View File

@ -182,7 +182,6 @@ int hawk_rtx_matchvalwithucs (hawk_rtx_t* rtx, hawk_val_t* val, const hawk_ucs_t
if (x <= -1) return -1; if (x <= -1) return -1;
} }
x = matchtre_ucs( x = matchtre_ucs(
code, ((str->ptr == substr->ptr)? opt: (opt | HAWK_TRE_NOTBOL)), code, ((str->ptr == substr->ptr)? opt: (opt | HAWK_TRE_NOTBOL)),
substr, match, submat, hawk_rtx_getgem(rtx) substr, match, submat, hawk_rtx_getgem(rtx)