Reaper Grimm
Register | 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 22:43. 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 01-04-03 03:01 #
Anders is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7287
Registered: 07-00


My fault :P

And dont you mean

vsnprintf(tempstr, 10239, s, args)

Old Post 01-04-03 03:29 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || 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 01-05-03 at 04:34

Old Post 01-05-03 04:07 #
Anders is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || 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 01-05-03 at 04:34

Old Post 01-05-03 04:16 #
Anders is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Arioch
not arioch


Posts: 2772
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 01-05-03 04:40 #
Arioch is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 22:43. 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.

Message Board Statistics