#13 wrong size in vsnprintf in l2tpns.c function _log - solved

open
nobody
None
5
2011-08-02
2011-08-02
No

Bug in l2tpns.c in in function _log: Fix included (please verify).

// fixed size of 4095 in vsnprintf is wrong, must not be greater than sizeof(message) from the struct. Otherwise you get *** buffer overflow detected *** when compiled under recent gcc. With this fix, l2tpns compiles and works again.
// replace as shown in l2tpns.c in function _log
- vsnprintf(ringbuffer->buffer[ringbuffer->tail].message, 4095, format, ap);
+ vsnprintf(ringbuffer->buffer[ringbuffer->tail].message, sizeof(ringbuffer->buffer[ringbuffer->tail].message), format, ap);

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks