mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
IIS version improvements
This commit is contained in:
@@ -1206,7 +1206,26 @@ char *log_escape(apr_pool_t *mp, const char *text) {
|
||||
}
|
||||
|
||||
char *log_escape_nq(apr_pool_t *mp, const char *text) {
|
||||
#ifdef VERSION_IIS
|
||||
int l = 0;
|
||||
|
||||
// this is a workaround for unknown bug that causes 'text' sometimes to lack zero-termination
|
||||
//
|
||||
__try
|
||||
{
|
||||
l = text ? strlen(text) : 0;
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
l = -1;
|
||||
}
|
||||
if(l < 0)
|
||||
return _log_escape(mp, "BUG: see log_escape_nq()", 24, 0, 0, 0);
|
||||
|
||||
return _log_escape(mp, (const unsigned char *)text, l, 0, 0, 0);
|
||||
#else
|
||||
return _log_escape(mp, (const unsigned char *)text, text ? strlen(text) : 0, 0, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *log_escape_ex(apr_pool_t *mp, const char *text, unsigned long int text_length) {
|
||||
|
Reference in New Issue
Block a user