if (ret == -1) {
return NULL;
}
- if (len > 255) {
- SCLogError(SC_ERR_NOT_SUPPORTED, "Currently we don't support content "
- "length greater than 255. Please split the pattern, if "
- "length > 255. The length of the content after "
- "normalization is \"%"PRIu16"\".", len);
- return NULL;
- }
cd = SCMalloc(sizeof(DetectContentData) + len);
if (unlikely(cd == NULL)) {
return result;
}
+/**
+ * Tests that content lengths > 255 are supported.
+ */
int DetectContentParseTest42(void)
{
int result = 1;
teststring[idx++] = '\0';
cd = DetectContentParse(teststring);
- if (cd != NULL) {
- SCLogDebug("expected NULL got %p: ", cd);
+ if (cd == NULL) {
+ SCLogDebug("expected not NULL");
result = 0;
}
return result;
}
+/**
+ * Tests that content lengths > 255 are supported.
+ */
int DetectContentParseTest44(void)
{
int result = 1;
teststring[idx++] = '\0';
cd = DetectContentParse(teststring);
- if (cd != NULL) {
- SCLogDebug("expected NULL got %p: ", cd);
+ if (cd == NULL) {
+ SCLogDebug("expected not NULL");
result = 0;
}
typedef struct DetectContentData_ {
uint8_t *content;
- uint8_t content_len;
- uint8_t replace_len;
+ uint16_t content_len;
+ uint16_t replace_len;
/* for chopped fast pattern, the length */
uint16_t fp_chop_len;
/* would want to move PatIntId here and flags down to remove the padding