PRB: _searchenv() Does Not Check the Buffer SizeLast reviewed: July 25, 1997Article ID: Q129479 |
The information in this article applies to:
SYMPTOMSIf _searchenv() is called with a pathname buffer (third parameter) that has a length shorter than the length of the fully qualified path name returned, the function will overwrite the buffer.
CAUSEAs the documentation states, "You must ensure that there is sufficient space for the constructed path." A number of CRT routines, including _searchenv(), do not take a size parameter and cannot check to see if the buffer passed is big enough to hold the data. It is up to the programmer to make sure the buffer is large enough for the data.
RESOLUTIONTo avoid potential access violations that occur because of the overwrite, do one of the following:
STATUSThis behavior is by design. Keywords : CRTIss Version : 2.1 4.0 5.0 Platform : NT WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |