![]() |
Re: Bug Thread: Discussion
Quote:
|
Re: Bug Thread: Discussion
Quote:
This probably means a stack overflow. |
Re: Bug Thread: Discussion
Quote:
|
Re: Bug Thread: Discussion
In-game messages like "I'm setting taxes to 0% so you go bankrupt" can cause the turn to crash when they are viewed.
The game formats messages that are displayed on the screen using one of the printf calls. It should pass ( ..., "%s", message ) for user-entered messages. But instead it passes ( ..., message ). So if 'message' contains printf formatting, it will expect additional arguments. And if the printf code is '%s' (spaces between the '%' and 's' don't matter), it will treat whatever happens to be on the stack as an address to read a string from. If this address is invalid, that can cause a crash. |
Re: Bug Thread: Discussion
Quote:
http://en.wikipedia.org/wiki/Format_string_attack |
Re: Bug Thread: Discussion
Oh, wow. %n does not modify the output from printf but instead treats its arguments are a memory address and sets it to the number of characters printed so far. That raises the threat potential from printing out the contents of your Dom3 process to modifying memory, including the instruction pointer. http://julianor.tripod.com/bc/formatstring-1.2.pdf
It's interesting that vfb reports that this will cause crashes. Maybe Dom3 is compiled in a mode that does stricter checking of printf, and throws an exception if the wrong number of arguments is supplied. In that case it's not a security threat after all. -Max |
Re: Bug Thread: Discussion
Quote:
The printf call used does check for a null argument to %s on the stack and prints "(null)" in that case, but it's going to seg fault (crash) if there's something on the stack like a random integer value. It's impossible to do a compile-time check of the printf arg count when the format string itself is variable. And that's the problem here, the format string should be "%s" instead of the user-entered message. It's also impossible for a library function like printf to know how many arguments it was actually passed. Whatever is on the stack is just there, and it will try to use it according to the format string. |
Re: Bug Thread: Discussion
Black Laurel, Ivy Crown and Crown of the Ivy King do not provide an armor to the wearer, bug or WAD? I remember that a couple of crowns were missing their armor, and KO said something like "remind me of any other crowns like this".
|
Re: Bug Thread: Discussion
Should they provide armor? They're leaves after all :)
|
Re: Bug Thread: Discussion
I don't know if this has been mentioned but:
If I use the random map generator once, quit that game and generate a new map I get the exact same map grahpics but with each province redefined (water provinces will often be land and vice versa). |
All times are GMT -4. The time now is 04:01 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.