Bug 3541 - buffer size safe va
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: All All
: P3 trivial
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2008-02-13 16:44 EST by Pat Raynor
Modified: 2008-03-25 17:39:15 EDT
0 users

See Also:


Attachments
said patch (1.94 KB, patch)
2008-02-13 16:45 EST, Pat Raynor

Description Pat Raynor 2008-02-13 16:44:00 EST
in q_shared.c around line 954:

/*
============
va

does a varargs printf into a temp buffer, so I don't need to have
varargs versions of all text functions.
FIXME: make this buffer size safe someday
============
*/

this patch makes va buffer size safe by using vsnprintf.

However, this patch could be improved by providing a vsnprintf for QVMs as the patch just uses a simple wrapper.
Comment 1 Pat Raynor 2008-02-13 16:45:31 EST
Created attachment 1660 [details]
said patch
Comment 2 Thilo Schulz 2008-03-25 17:39:15 EDT
Thank you for the info, I fixed it in revision 1277 by making all functions formerly calling vsprintf use versions with length check.