antirez / antirez/hping

gcc warns memcpy will always overflow: memcpy(&icmp, p, sizeof(subtcp)); (Mac OS)

Open
#53 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
1.7k
Forks
364
PR merge metrics
No merged PRs in 30d

Description

I get this compiler warning on Mac OS.

This looks like a buffer overflow that needs to get fixed.

```
gcc -c -O2 -Wall -g scan.c
scan.c:459:4: warning: 'memcpy' will always overflow; destination buffer has size 8, but size argument is 20 [-Wbuiltin-memcpy-chk-size]
memcpy(&icmp, p, sizeof(subtcp));
^
1 warning generated.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.