We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cc -std=c99 -O2 -fPIC -finline-functions -Wall -W -Wunused -pedantic -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wcast-qual -Wextra -o eschalot eschalot.c -lpthread -lssl -lcrypto In function ‘setoptions’, inlined from ‘main’ at eschalot.c:172:2: eschalot.c:788:4: warning: ‘strncpy’ specified bound 17 equals destination size [-Wstringop-truncation] strncpy(prefix, optarg, ONION_LENP1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc -std=c99 -O2 -fPIC -finline-functions -Wall -W -Wunused -pedantic -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wcast-qual -Wextra -o worgen worgen.c
while running root@io:/opt/eschalot/eschalot# ./eschalot -ct5 -p test ERROR: malloc(buf->length + 1) failed!
The text was updated successfully, but these errors were encountered:
The error happened because malloc couldn't allocate enough memory, so the program aborted.
malloc
The warning happened because of this call to strncpy. The size of prefix is exactly ONION_LENP1, so the string might not be null-terminated.
strncpy
prefix
ONION_LENP1
I would suggest to a developer to use snprintf, since it guarantees the string to be null terminated.
snprintf
Sorry, something went wrong.
No branches or pull requests
while running
root@io:/opt/eschalot/eschalot# ./eschalot -ct5 -p test
ERROR: malloc(buf->length + 1) failed!
The text was updated successfully, but these errors were encountered: