Skip to content

Instantly share code, notes, and snippets.

@jonm
Created October 12, 2015 03:04
Show Gist options
  • Save jonm/55494cce0191e108677e to your computer and use it in GitHub Desktop.
Save jonm/55494cce0191e108677e to your computer and use it in GitHub Desktop.
insecure(?) format string
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -Werror -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o act.wizard.o act.wizard.c
act.wizard.c:243:24: error: format string is not a string literal
(potentially insecure) [-Werror,-Wformat-security]
sprintf(string, tmp);
^~~
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^
...
7 errors generated.
make: *** [act.wizard.o] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment