{"action":"created","issue":{"url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1312","labels_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1312/labels{/name}","comments_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1312/comments","events_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1312/events","html_url":"https://github.com/FreeRADIUS/freeradius-server/issues/1312","id":110328116,"number":1312,"title":"Problems with \\0 (null) terminators in string/regex","user":{"login":"jpereira","id":254448,"avatar_url":"https://avatars.githubusercontent.com/u/254448?v=3","gravatar_id":"","url":"https://api.github.com/users/jpereira","html_url":"https://github.com/jpereira","followers_url":"https://api.github.com/users/jpereira/followers","following_url":"https://api.github.com/users/jpereira/following{/other_user}","gists_url":"https://api.github.com/users/jpereira/gists{/gist_id}","starred_url":"https://api.github.com/users/jpereira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpereira/subscriptions","organizations_url":"https://api.github.com/users/jpereira/orgs","repos_url":"https://api.github.com/users/jpereira/repos","events_url":"https://api.github.com/users/jpereira/events{/privacy}","received_events_url":"https://api.github.com/users/jpereira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-07T22:06:55Z","updated_at":"2015-10-08T01:31:13Z","closed_at":null,"body":"Hi,\r\n\r\nI think that we have a new issue related to string/regex. Probably a better debug message or a wrong behavior? I using v3.0.x/HEAD\r\n\r\n```\r\nWed Oct  7 22:04:24 2015 : Debug: %{string: &ADSL-Agent-Circuit-Id}\r\nWed Oct  7 22:04:24 2015 : Debug: Parsed xlat tree:\r\nWed Oct  7 22:04:24 2015 : Debug: xlat --> string\r\nWed Oct  7 22:04:24 2015 : Debug: {\r\nWed Oct  7 22:04:24 2015 : Debug:       literal -->  &ADSL-Agent-Circuit-Id\r\nWed Oct  7 22:04:24 2015 : Debug: }\r\nWed Oct  7 22:04:24 2015 : Debug: (0)         EXPAND %{string: &ADSL-Agent-Circuit-Id}\r\nWed Oct  7 22:04:24 2015 : Debug: (0)            --> 38:c8:5c:b4:1a:06\\000#MY-SSID\\000o\r\nWed Oct  7 22:04:24 2015 : Debug: (0)         if (&ADSL-Agent-Circuit-Id) {\r\nWed Oct  7 22:04:24 2015 : Debug: (0)         if (&ADSL-Agent-Circuit-Id)  -> TRUE\r\nWed Oct  7 22:04:24 2015 : Debug: (0)         if (&ADSL-Agent-Circuit-Id)  {\r\nWed Oct  7 22:04:24 2015 : Debug: (0)           if (&ADSL-Agent-Circuit-Id =~ /^(.+)\\000(.+)\\000(.+)$/) {\r\nWed Oct  7 22:04:24 2015 : Debug: Clearing 4 matches\r\nWed Oct  7 22:04:24 2015 : Debug: (0)           if (&ADSL-Agent-Circuit-Id =~ /^(.+)\\000(.+)\\000(.+)$/)  -> FALSE\r\nWed Oct  7 22:04:24 2015 : Debug: (0)         } # if (&ADSL-Agent-Circuit-Id)  = noop\r\nWed Oct  7 22:04:24 2015 : Debug: (0)       } # policy mcare-parse.set_mobicare_ssid_options = noop\r\nWed Oct  7 22:04:24 2015 : Debug: (0)     } # policy mcare-parse.run = noop\r\n```\r\n\r\nThe ADSL-Agent-Circuit-Id data.\r\n\r\n```\r\nADSL-Agent-Circuit-Id = 0x33383a63383a35633a62343a31613a303600234e45542d4232423243006f\r\n```"},"comment":{"url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/comments/146388968","html_url":"https://github.com/FreeRADIUS/freeradius-server/issues/1312#issuecomment-146388968","issue_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1312","id":146388968,"user":{"login":"arr2036","id":791758,"avatar_url":"https://avatars.githubusercontent.com/u/791758?v=3","gravatar_id":"","url":"https://api.github.com/users/arr2036","html_url":"https://github.com/arr2036","followers_url":"https://api.github.com/users/arr2036/followers","following_url":"https://api.github.com/users/arr2036/following{/other_user}","gists_url":"https://api.github.com/users/arr2036/gists{/gist_id}","starred_url":"https://api.github.com/users/arr2036/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arr2036/subscriptions","organizations_url":"https://api.github.com/users/arr2036/orgs","repos_url":"https://api.github.com/users/arr2036/repos","events_url":"https://api.github.com/users/arr2036/events{/privacy}","received_events_url":"https://api.github.com/users/arr2036/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T01:31:13Z","updated_at":"2015-10-08T01:31:13Z","body":"It's a problem.  FreeRADIUS makes use of both pcre, and the BSD regex functions which take length parameters.  In both these cases the regex functions are able to deal with embedded \\0s fine.\r\n\r\nIn the case of a string containing an embedded \\0 and one of the none \\0 safe regular functions being used, condition evaluation fails."}}