|
MaxDB_ORG/sys/src/SAPDB/WebDAV/Handler/WDVHandler_CommonUtils.c:
WDVH_Bool getLockTokenHeader(sapdbwa_HttpRequestP request,
WDVH_Char *sLockToken,
WDVH_Char *errormsg)
{
WDVH_Char *temp1, *temp2, *temp4, *temp5;
WDVH_UInt4 length;
WDVH_Char temp3[WDVH_MAX_IF_HEADER_LEN];
if (request==NULL || sLockToken==NULL || errormsg==NULL)
return WDVH_False;
temp4 = (char*)sapdbwa_GetHeader(request,"Lock-Token");
if (temp4 != NULL) {
strcpy(temp3,temp4);
[...]
The variable temp3 is a fixed-length stack buffer. The function sapdbwa_GetHeader() returns the user supplied value for Lock-Token. This user-supplied value is then copied into the fixed-size buffer using a strcpy() call. Due to no boundary checking, it is possible to overflow the stack buffer and overwrite stack memory, ultimately leading to control of execution flow and execution of arbitrary code.
|