View Single Post
  #2315  
Old December 2nd, 2008, 08:21 AM
Soyweiser's Avatar

Soyweiser Soyweiser is offline
Colonel
 
Join Date: Nov 2008
Posts: 1,735
Thanks: 272
Thanked 120 Times in 93 Posts
Soyweiser is on a distinguished road
Default Re: Bug Thread: Discussion

Quote:
Originally Posted by vfb View Post
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.
This is a serious problem. This can cause much more than a simple crash. If someone makes a malicious message, it could take over your computer.

http://en.wikipedia.org/wiki/Format_string_attack
Reply With Quote