Skip to content

Instantly share code, notes, and snippets.

@sshine
Created March 28, 2019 13:44
Show Gist options
  • Save sshine/85387677709d67d666e404377cf1ef2b to your computer and use it in GitHub Desktop.
Save sshine/85387677709d67d666e404377cf1ef2b to your computer and use it in GitHub Desktop.
strncpy(d->pwd, crypt(arg, d->character->player.name), 10);
/*
(gdb) print d->pwd
$6 = '\000' <repeats 11 times>
(gdb) print arg
$7 = 0x7fffffffdd80 "xxxxx"
(gdb) print d->character->player.name
$8 = 0x5555558cd8b0 "Simon"
(gdb) continue
Continuing.
Program received signal SIGSEGV, Segmentation fault.
__strncpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:298
298 ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment