]> git.pond.sub.org Git - empserver/commit
files could clobber the game when reading confirmation fails
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 14 Feb 2010 18:29:13 +0000 (19:29 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 10 Mar 2010 08:38:03 +0000 (09:38 +0100)
commit2b4e97730dff9c8e443bee87159332bb9870b3b8
tree719802ecce22060a99aedd8b8033d1ed6f14b479
parentf9d6149db3b84a161e619aaf1ac5aff233a4cddb
files could clobber the game when reading confirmation fails

fgets() fails on read error or EOF.  When it fails, it doesn't touch
the buffer.  Since files didn't check its return value, it read an
uninitialized character from the buffer.  If that happened to be 'y'
or 'Y', it happily clobbered the game.
src/util/files.c