[reSIProcate] Issue compiling Security.cxx

Adam Roach adam at nostrum.com
Mon Sep 9 13:03:49 CDT 2013


On 9/9/13 11:23, Dario Bozzali wrote:
>
> I got the latest trunk revision of Resiprocate repository (10430), but 
> I’m facing an issue while compiling Security.cxx using Visual Studio 2005.
>
> In particular the error that I obtain is the following one:
>
> 1>.\ssl\Security.cxx(177) : error C3861: 'snprintf': identifier not found
>
> I think that it could be necessary to use _snprintf instead of 
> snprintf function, for example using a define like in the excerpt of 
> code that I reported below.
>

The problem here is that snprintf() guarantees null termination, while 
Windows' _snprintf() does not (which can lead to some really nasty 
security bugs). Because of this flaw, the general guidance that I offer 
is that no one should ever use use Windows' _snprintf() -- it's 
fundamentally broken.

I think what you really need to do is define a new function that wraps 
_snprintf_s, with a "count" argument set to "_TRUNCATE".

/a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20130909/837f1a5e/attachment.htm>


More information about the resiprocate-devel mailing list