Add a nice error message when we exceeded address buffer limit for a rule

remotes/origin/HEAD
Anoop Saldanha 13 years ago committed by Victor Julien
parent 7495f59773
commit d39b7b72bd

@ -926,6 +926,12 @@ int DetectAddressParse2(DetectAddressHead *gh, DetectAddressHead *ghn, char *s,
SCLogDebug("s %s negate %s", s, negate ? "true" : "false");
for (u = 0, x = 0; u < size && x < sizeof(address); u++) {
if (x == (sizeof(address) - 1)) {
SCLogError(SC_ERR_ADDRESS_ENGINE_GENERIC, "Hit the address buffer"
" limit for the supplied address. Invalidating sig. "
"Please file a bug report on this.");
goto error;
}
address[x] = s[u];
x++;

@ -100,6 +100,7 @@ const char * SCErrorToString(SCError err)
CASE_CODE (SC_ERR_POOL_INIT);
CASE_CODE (SC_ERR_UNIMPLEMENTED);
CASE_CODE (SC_ERR_FAST_LOG_GENERIC);
CASE_CODE (SC_ERR_ADDRESS_ENGINE_GENERIC);
CASE_CODE (SC_ERR_IPONLY_RADIX);
CASE_CODE (SC_ERR_DEBUG_LOG_GENERIC);
CASE_CODE (SC_ERR_UNIFIED_LOG_GENERIC);

Loading…
Cancel
Save