Fix buffer overflow in build

Remote hole, can smash the stack.  Broken when Empire 2 added the
confirmation prompt.
This commit is contained in:
Markus Armbruster 2012-03-20 20:28:46 +01:00
parent 6c927dc3c3
commit 5501efa278

View file

@ -28,7 +28,7 @@
* *
* Known contributors to this file: * Known contributors to this file:
* Steve McClure, 1998-2000 * Steve McClure, 1998-2000
* Markus Armbruster, 2004-2011 * Markus Armbruster, 2004-2012
*/ */
#include <config.h> #include <config.h>
@ -160,8 +160,8 @@ buil(void)
if (number > 20) { if (number > 20) {
char bstr[80]; char bstr[80];
sprintf(bstr, sprintf(bstr,
"Are you sure that you want to build %s of them? ", "Are you sure that you want to build %d of them? ",
player->argp[4]); number);
p = getstarg(player->argp[6], bstr, buf); p = getstarg(player->argp[6], bstr, buf);
if (!p || *p != 'y') if (!p || *p != 'y')
return RET_SYN; return RET_SYN;