Cacodemon
User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > overflowable buffer in eternity
 
Author
All times are GMT. The time now is 13:29. Post New Thread    Post A Reply
Anders
No one knows I'm schepe


Posts: 428
Registered: 03-02


found this in c_io.c C_Printf.

unsigned char tempstr[10240];
...
vsprintf(tempstr, s, args);

this could cause an overflow, but this is easily fixed by using
vsnprintf(tempstr, 10240, s, args) instead.

__________________
++++++++++[>++++++++++>++++++++++++>+++++++++++>++
+>+<<<<<-]>.>-.>>++.<<<++.>>+.+++.<--.>-----.+++++
+.>.<<<-----.>>-.<<++++.>>>.<<<++.------.>++++.>>>.

Old Post Jan 4 2003 03:01 #
Anders is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
fraggle
Filled with the code of Doom


Posts: 8164
Registered: 07-00


My fault :P

And dont you mean

vsnprintf(tempstr, 10239, s, args)

Old Post Jan 4 2003 03:29 #
fraggle is offline Twitter account Youtube Twitch Github || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Anders
No one knows I'm schepe


Posts: 428
Registered: 03-02


no, it will take the size of the buffer, it will leave room for the zero automagicaly.

__________________
++++++++++[>++++++++++>++++++++++++>+++++++++++>++
+>+<<<<<-]>.>-.>>++.<<<++.>>+.+++.<--.>-----.+++++
+.>.<<<-----.>>-.<<++++.>>>.<<<++.------.>++++.>>>.

Last edited by Anders on Jan 5 2003 at 04:34

Old Post Jan 5 2003 04:07 #
Anders is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Anders
No one knows I'm schepe


Posts: 428
Registered: 03-02


oh, and the retards at ms, who like to complicate things call it _vsnprintf instead.

__________________
++++++++++[>++++++++++>++++++++++++>+++++++++++>++
+>+<<<<<-]>.>-.>>++.<<<++.>>+.+++.<--.>-----.+++++
+.>.<<<-----.>>-.<<++++.>>>.<<<++.------.>++++.>>>.

Last edited by Anders on Jan 5 2003 at 04:34

Old Post Jan 5 2003 04:16 #
Anders is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
Arioch
not arioch


Posts: 2796
Registered: 05-00


#ifdef __MSVC__
#define vsnprintf _vsnprintf
#endif

or something similar

__________________
Join mewseCult(tm), heh.

<+phunk> i have to send 8 photos of myself in
<@fraggle> one for each angle
<@fraggle> they're going to make you into a doom monster

Old Post Jan 5 2003 04:40 #
Arioch is offline || Blog || PM || Post History || Add Buddy IP || Edit || Quote
All times are GMT. The time now is 13:29. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > overflowable buffer in eternity

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.