(svn r769) Fixed a tiny mistake in the _userstring boundary check. Let's hope I got it right this time.
authorpasky
Mon, 22 Nov 2004 21:53:19 +0000
changeset 487 03a9f4ffe58b
parent 486 dadcb8d5a6bd
child 488 8fb5f00d6d90
(svn r769) Fixed a tiny mistake in the _userstring boundary check. Let's hope I got it right this time.
station_gui.c
--- a/station_gui.c	Mon Nov 22 21:48:40 2004 +0000
+++ b/station_gui.c	Mon Nov 22 21:53:19 2004 +0000
@@ -375,7 +375,7 @@
 		b += 3;
 
 		for(i=0; i!=NUM_CARGO; i++) {
-			if (b + 5 > USERSTRING_LEN - 1)
+			if ((b - (byte *) &_userstring) + 5 > USERSTRING_LEN - 1)
 				break;
 			if (st->goods[i].waiting_acceptance & 0x8000) {
 				b[0] = 0x81;