Fix cplen calculation

This commit is contained in:
zhaozihanzzh 2024-04-10 21:41:05 +08:00 committed by zhaozihanzzh
parent 8b0b62dd23
commit 99065f0781
1 changed files with 1 additions and 1 deletions

View File

@ -419,7 +419,7 @@ ff_hook_getsockname(int fd, struct sockaddr *name,
SYSCALL(FF_SO_GETSOCKNAME, args);
if (ret == 0) {
socklen_t cplen = *namelen ? *sh_namelen > *namelen
socklen_t cplen = *namelen < *sh_namelen ? *namelen
: *sh_namelen;
rte_memcpy(name, sh_name, cplen);
*namelen = *sh_namelen;