{"action":"created","comment":{"url":"https://api.github.com/repos/inliniac/suricata/pulls/comments/33574730","id":33574730,"diff_hunk":"@@ -169,6 +175,117 @@ static int DetectFiledataParseTest02(void)\n \n     return result;\n }\n+\n+static int DetectFiledataParseTest03(void)\n+{\n+    DetectEngineCtx *de_ctx = NULL;\n+    int result = 0;\n+\n+    de_ctx = DetectEngineCtxInit();\n+    if (de_ctx == NULL)\n+        goto end;\n+\n+    de_ctx->flags |= DE_QUIET;\n+    de_ctx->sig_list = SigInit(de_ctx,\n+                               \"alert tcp any any -> any 25 \"\n+                               \"(msg:\\\"test\\\"; flow:to_server,established; file_data; content:\\\"abc\\\"; sid:1;)\");\n+    if (de_ctx->sig_list == NULL) {\n+        printf(\"sig parse failed: \");\n+        goto end;\n+    }\n+\n+    if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_PMATCH] != NULL) {\n+        printf(\"content is still in PMATCH list: \");\n+        goto end;\n+    }\n+\n+    if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_FILEDATA] == NULL) {\n+       printf(\"content not in FILEDATA list: \");\n+       goto end;\n+    }\n+\n+    result = 1;\n+end:\n+    SigGroupCleanup(de_ctx);\n+    SigCleanSignatures(de_ctx);\n+    DetectEngineCtxFree(de_ctx);\n+\n+    return result;\n+}\n+\n+static int DetectFiledataParseTest04(void)\n+{\n+    DetectEngineCtx *de_ctx = NULL;\n+    int result = 0;\n+\n+    de_ctx = DetectEngineCtxInit();\n+    if (de_ctx == NULL)\n+        goto end;\n+\n+    de_ctx->flags |= DE_QUIET;\n+    de_ctx->sig_list = SigInit(de_ctx,\n+                               \"alert smtp any any -> any any \"\n+                               \"(msg:\\\"test\\\"; flow:to_client,established; file_data; content:\\\"abc\\\"; sid:1;)\");\n+    if (de_ctx->sig_list == NULL) {\n+        printf(\"sig parse failed: \");\n+        goto end;\n+    }\n+\n+    if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_PMATCH] != NULL) {\n+        printf(\"content is still in PMATCH list: \");\n+        goto end;\n+    }\n+\n+    if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_FILEDATA] == NULL) {\n+       printf(\"content not in FILEDATA list: \");\n+       goto end;\n+    }\n+\n+    result = 1;\n+end:\n+    SigGroupCleanup(de_ctx);\n+    SigCleanSignatures(de_ctx);\n+    DetectEngineCtxFree(de_ctx);\n+\n+    return result;\n+}\n+\n+static int DetectFiledataParseTest05(void)\n+{\n+    DetectEngineCtx *de_ctx = NULL;\n+    int result = 0;\n+\n+    de_ctx = DetectEngineCtxInit();\n+    if (de_ctx == NULL)\n+        goto end;\n+\n+    de_ctx->flags |= DE_QUIET;\n+    de_ctx->sig_list = SigInit(de_ctx,\n+                               \"alert http any any -> any any \"\n+                               \"(msg:\\\"test\\\"; flow:to_server,established; file_data; content:\\\"abc\\\"; sid:1;)\");\n+    if (de_ctx->sig_list == NULL) {\n+        printf(\"sig parse failed: \");","path":"src/detect-file-data.c","position":111,"original_position":111,"commit_id":"7ba592b887193ea5303a3450eb30867c98f49328","original_commit_id":"7ba592b887193ea5303a3450eb30867c98f49328","user":{"login":"inliniac","id":719366,"avatar_url":"https://avatars.githubusercontent.com/u/719366?v=3","gravatar_id":"","url":"https://api.github.com/users/inliniac","html_url":"https://github.com/inliniac","followers_url":"https://api.github.com/users/inliniac/followers","following_url":"https://api.github.com/users/inliniac/following{/other_user}","gists_url":"https://api.github.com/users/inliniac/gists{/gist_id}","starred_url":"https://api.github.com/users/inliniac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inliniac/subscriptions","organizations_url":"https://api.github.com/users/inliniac/orgs","repos_url":"https://api.github.com/users/inliniac/repos","events_url":"https://api.github.com/users/inliniac/events{/privacy}","received_events_url":"https://api.github.com/users/inliniac/received_events","type":"User","site_admin":false},"body":"same here","created_at":"2015-06-30T13:56:49Z","updated_at":"2015-06-30T13:56:49Z","html_url":"https://github.com/inliniac/suricata/pull/1573#discussion_r33574730","pull_request_url":"https://api.github.com/repos/inliniac/suricata/pulls/1573","_links":{"self":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/comments/33574730"},"html":{"href":"https://github.com/inliniac/suricata/pull/1573#discussion_r33574730"},"pull_request":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/1573"}}},"pull_request":{"url":"https://api.github.com/repos/inliniac/suricata/pulls/1573","id":38863740,"html_url":"https://github.com/inliniac/suricata/pull/1573","diff_url":"https://github.com/inliniac/suricata/pull/1573.diff","patch_url":"https://github.com/inliniac/suricata/pull/1573.patch","issue_url":"https://api.github.com/repos/inliniac/suricata/issues/1573","number":1573,"state":"open","locked":false,"title":"file_data: check for signature alproto and flow","user":{"login":"glongo","id":101933,"avatar_url":"https://avatars.githubusercontent.com/u/101933?v=3","gravatar_id":"","url":"https://api.github.com/users/glongo","html_url":"https://github.com/glongo","followers_url":"https://api.github.com/users/glongo/followers","following_url":"https://api.github.com/users/glongo/following{/other_user}","gists_url":"https://api.github.com/users/glongo/gists{/gist_id}","starred_url":"https://api.github.com/users/glongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glongo/subscriptions","organizations_url":"https://api.github.com/users/glongo/orgs","repos_url":"https://api.github.com/users/glongo/repos","events_url":"https://api.github.com/users/glongo/events{/privacy}","received_events_url":"https://api.github.com/users/glongo/received_events","type":"User","site_admin":false},"body":"This fixes some broken tests.\r\n\r\nPrscript:\r\n- PR glongo: https://buildbot.openinfosecfoundation.org/builders/glongo/builds/49\r\n- PR glongo-pcap: https://buildbot.openinfosecfoundation.org/builders/glongo-pcap/builds/48\r\n\r\nLast PR: https://github.com/inliniac/suricata/pull/1571","created_at":"2015-06-30T10:33:38Z","updated_at":"2015-06-30T13:56:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"151087e4932816a118d85647caabe2e06c1e3ceb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/inliniac/suricata/pulls/1573/commits","review_comments_url":"https://api.github.com/repos/inliniac/suricata/pulls/1573/comments","review_comment_url":"https://api.github.com/repos/inliniac/suricata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inliniac/suricata/issues/1573/comments","statuses_url":"https://api.github.com/repos/inliniac/suricata/statuses/7ba592b887193ea5303a3450eb30867c98f49328","head":{"label":"glongo:fix-smtp-filedata-v3","ref":"fix-smtp-filedata-v3","sha":"7ba592b887193ea5303a3450eb30867c98f49328","user":{"login":"glongo","id":101933,"avatar_url":"https://avatars.githubusercontent.com/u/101933?v=3","gravatar_id":"","url":"https://api.github.com/users/glongo","html_url":"https://github.com/glongo","followers_url":"https://api.github.com/users/glongo/followers","following_url":"https://api.github.com/users/glongo/following{/other_user}","gists_url":"https://api.github.com/users/glongo/gists{/gist_id}","starred_url":"https://api.github.com/users/glongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glongo/subscriptions","organizations_url":"https://api.github.com/users/glongo/orgs","repos_url":"https://api.github.com/users/glongo/repos","events_url":"https://api.github.com/users/glongo/events{/privacy}","received_events_url":"https://api.github.com/users/glongo/received_events","type":"User","site_admin":false},"repo":{"id":13040040,"name":"suricata","full_name":"glongo/suricata","owner":{"login":"glongo","id":101933,"avatar_url":"https://avatars.githubusercontent.com/u/101933?v=3","gravatar_id":"","url":"https://api.github.com/users/glongo","html_url":"https://github.com/glongo","followers_url":"https://api.github.com/users/glongo/followers","following_url":"https://api.github.com/users/glongo/following{/other_user}","gists_url":"https://api.github.com/users/glongo/gists{/gist_id}","starred_url":"https://api.github.com/users/glongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glongo/subscriptions","organizations_url":"https://api.github.com/users/glongo/orgs","repos_url":"https://api.github.com/users/glongo/repos","events_url":"https://api.github.com/users/glongo/events{/privacy}","received_events_url":"https://api.github.com/users/glongo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/glongo/suricata","description":"Mirror of the official OISF Suricata git repository","fork":true,"url":"https://api.github.com/repos/glongo/suricata","forks_url":"https://api.github.com/repos/glongo/suricata/forks","keys_url":"https://api.github.com/repos/glongo/suricata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glongo/suricata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glongo/suricata/teams","hooks_url":"https://api.github.com/repos/glongo/suricata/hooks","issue_events_url":"https://api.github.com/repos/glongo/suricata/issues/events{/number}","events_url":"https://api.github.com/repos/glongo/suricata/events","assignees_url":"https://api.github.com/repos/glongo/suricata/assignees{/user}","branches_url":"https://api.github.com/repos/glongo/suricata/branches{/branch}","tags_url":"https://api.github.com/repos/glongo/suricata/tags","blobs_url":"https://api.github.com/repos/glongo/suricata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glongo/suricata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glongo/suricata/git/refs{/sha}","trees_url":"https://api.github.com/repos/glongo/suricata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glongo/suricata/statuses/{sha}","languages_url":"https://api.github.com/repos/glongo/suricata/languages","stargazers_url":"https://api.github.com/repos/glongo/suricata/stargazers","contributors_url":"https://api.github.com/repos/glongo/suricata/contributors","subscribers_url":"https://api.github.com/repos/glongo/suricata/subscribers","subscription_url":"https://api.github.com/repos/glongo/suricata/subscription","commits_url":"https://api.github.com/repos/glongo/suricata/commits{/sha}","git_commits_url":"https://api.github.com/repos/glongo/suricata/git/commits{/sha}","comments_url":"https://api.github.com/repos/glongo/suricata/comments{/number}","issue_comment_url":"https://api.github.com/repos/glongo/suricata/issues/comments{/number}","contents_url":"https://api.github.com/repos/glongo/suricata/contents/{+path}","compare_url":"https://api.github.com/repos/glongo/suricata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glongo/suricata/merges","archive_url":"https://api.github.com/repos/glongo/suricata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glongo/suricata/downloads","issues_url":"https://api.github.com/repos/glongo/suricata/issues{/number}","pulls_url":"https://api.github.com/repos/glongo/suricata/pulls{/number}","milestones_url":"https://api.github.com/repos/glongo/suricata/milestones{/number}","notifications_url":"https://api.github.com/repos/glongo/suricata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glongo/suricata/labels{/name}","releases_url":"https://api.github.com/repos/glongo/suricata/releases{/id}","created_at":"2013-09-23T15:52:17Z","updated_at":"2015-05-02T21:15:07Z","pushed_at":"2015-06-30T10:15:59Z","git_url":"git://github.com/glongo/suricata.git","ssh_url":"git@github.com:glongo/suricata.git","clone_url":"https://github.com/glongo/suricata.git","svn_url":"https://github.com/glongo/suricata","homepage":"http://suricata-ids.org/","size":40370,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"inliniac:master","ref":"master","sha":"e583de05823c51694cb443d326e7b0ed13cb457e","user":{"login":"inliniac","id":719366,"avatar_url":"https://avatars.githubusercontent.com/u/719366?v=3","gravatar_id":"","url":"https://api.github.com/users/inliniac","html_url":"https://github.com/inliniac","followers_url":"https://api.github.com/users/inliniac/followers","following_url":"https://api.github.com/users/inliniac/following{/other_user}","gists_url":"https://api.github.com/users/inliniac/gists{/gist_id}","starred_url":"https://api.github.com/users/inliniac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inliniac/subscriptions","organizations_url":"https://api.github.com/users/inliniac/orgs","repos_url":"https://api.github.com/users/inliniac/repos","events_url":"https://api.github.com/users/inliniac/events{/privacy}","received_events_url":"https://api.github.com/users/inliniac/received_events","type":"User","site_admin":false},"repo":{"id":5410234,"name":"suricata","full_name":"inliniac/suricata","owner":{"login":"inliniac","id":719366,"avatar_url":"https://avatars.githubusercontent.com/u/719366?v=3","gravatar_id":"","url":"https://api.github.com/users/inliniac","html_url":"https://github.com/inliniac","followers_url":"https://api.github.com/users/inliniac/followers","following_url":"https://api.github.com/users/inliniac/following{/other_user}","gists_url":"https://api.github.com/users/inliniac/gists{/gist_id}","starred_url":"https://api.github.com/users/inliniac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inliniac/subscriptions","organizations_url":"https://api.github.com/users/inliniac/orgs","repos_url":"https://api.github.com/users/inliniac/repos","events_url":"https://api.github.com/users/inliniac/events{/privacy}","received_events_url":"https://api.github.com/users/inliniac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inliniac/suricata","description":"Mirror of the official OISF Suricata git repository","fork":false,"url":"https://api.github.com/repos/inliniac/suricata","forks_url":"https://api.github.com/repos/inliniac/suricata/forks","keys_url":"https://api.github.com/repos/inliniac/suricata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inliniac/suricata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inliniac/suricata/teams","hooks_url":"https://api.github.com/repos/inliniac/suricata/hooks","issue_events_url":"https://api.github.com/repos/inliniac/suricata/issues/events{/number}","events_url":"https://api.github.com/repos/inliniac/suricata/events","assignees_url":"https://api.github.com/repos/inliniac/suricata/assignees{/user}","branches_url":"https://api.github.com/repos/inliniac/suricata/branches{/branch}","tags_url":"https://api.github.com/repos/inliniac/suricata/tags","blobs_url":"https://api.github.com/repos/inliniac/suricata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inliniac/suricata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inliniac/suricata/git/refs{/sha}","trees_url":"https://api.github.com/repos/inliniac/suricata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inliniac/suricata/statuses/{sha}","languages_url":"https://api.github.com/repos/inliniac/suricata/languages","stargazers_url":"https://api.github.com/repos/inliniac/suricata/stargazers","contributors_url":"https://api.github.com/repos/inliniac/suricata/contributors","subscribers_url":"https://api.github.com/repos/inliniac/suricata/subscribers","subscription_url":"https://api.github.com/repos/inliniac/suricata/subscription","commits_url":"https://api.github.com/repos/inliniac/suricata/commits{/sha}","git_commits_url":"https://api.github.com/repos/inliniac/suricata/git/commits{/sha}","comments_url":"https://api.github.com/repos/inliniac/suricata/comments{/number}","issue_comment_url":"https://api.github.com/repos/inliniac/suricata/issues/comments{/number}","contents_url":"https://api.github.com/repos/inliniac/suricata/contents/{+path}","compare_url":"https://api.github.com/repos/inliniac/suricata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inliniac/suricata/merges","archive_url":"https://api.github.com/repos/inliniac/suricata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inliniac/suricata/downloads","issues_url":"https://api.github.com/repos/inliniac/suricata/issues{/number}","pulls_url":"https://api.github.com/repos/inliniac/suricata/pulls{/number}","milestones_url":"https://api.github.com/repos/inliniac/suricata/milestones{/number}","notifications_url":"https://api.github.com/repos/inliniac/suricata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inliniac/suricata/labels{/name}","releases_url":"https://api.github.com/repos/inliniac/suricata/releases{/id}","created_at":"2012-08-14T08:30:06Z","updated_at":"2015-06-29T09:45:25Z","pushed_at":"2015-06-30T10:33:39Z","git_url":"git://github.com/inliniac/suricata.git","ssh_url":"git@github.com:inliniac/suricata.git","clone_url":"https://github.com/inliniac/suricata.git","svn_url":"https://github.com/inliniac/suricata","homepage":"http://suricata-ids.org/","size":62395,"stargazers_count":185,"watchers_count":185,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":171,"mirror_url":null,"open_issues_count":35,"forks":171,"open_issues":35,"watchers":185,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/1573"},"html":{"href":"https://github.com/inliniac/suricata/pull/1573"},"issue":{"href":"https://api.github.com/repos/inliniac/suricata/issues/1573"},"comments":{"href":"https://api.github.com/repos/inliniac/suricata/issues/1573/comments"},"review_comments":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/1573/comments"},"review_comment":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/1573/commits"},"statuses":{"href":"https://api.github.com/repos/inliniac/suricata/statuses/7ba592b887193ea5303a3450eb30867c98f49328"}}}}