{"action":"created","issue":{"url":"https://api.github.com/repos/miekg/dns/issues/422","repository_url":"https://api.github.com/repos/miekg/dns","labels_url":"https://api.github.com/repos/miekg/dns/issues/422/labels{/name}","comments_url":"https://api.github.com/repos/miekg/dns/issues/422/comments","events_url":"https://api.github.com/repos/miekg/dns/issues/422/events","html_url":"https://github.com/miekg/dns/issues/422","id":191912985,"number":422,"title":"Too-long character-strings are parsed rather than rejected","user":{"login":"gibson042","id":1199584,"avatar_url":"https://avatars.githubusercontent.com/u/1199584?v=3","gravatar_id":"","url":"https://api.github.com/users/gibson042","html_url":"https://github.com/gibson042","followers_url":"https://api.github.com/users/gibson042/followers","following_url":"https://api.github.com/users/gibson042/following{/other_user}","gists_url":"https://api.github.com/users/gibson042/gists{/gist_id}","starred_url":"https://api.github.com/users/gibson042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibson042/subscriptions","organizations_url":"https://api.github.com/users/gibson042/orgs","repos_url":"https://api.github.com/users/gibson042/repos","events_url":"https://api.github.com/users/gibson042/events{/privacy}","received_events_url":"https://api.github.com/users/gibson042/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-28T03:37:32Z","updated_at":"2016-12-02T17:21:51Z","closed_at":null,"body":"(related: #420)\r\n\r\nI noticed this in #421, but did not immediately fix it there because the [behavior](https://github.com/miekg/dns/blob/46df8c9462fa287d54225d6bdebbcfd41da434f7/scan_rr.go#L89) seems to be [intentional](https://github.com/miekg/dns/blob/46df8c9462fa287d54225d6bdebbcfd41da434f7/parse_test.go#L240) (if misguided). When the length of a character-string exceeds 255 octets, the parser breaks it into _multiple_ strings, all but the last of length 255. But this can mask user errors, and in my opinion such cases should instead result in  `ParseError`s."},"comment":{"url":"https://api.github.com/repos/miekg/dns/issues/comments/264509767","html_url":"https://github.com/miekg/dns/issues/422#issuecomment-264509767","issue_url":"https://api.github.com/repos/miekg/dns/issues/422","id":264509767,"user":{"login":"gibson042","id":1199584,"avatar_url":"https://avatars.githubusercontent.com/u/1199584?v=3","gravatar_id":"","url":"https://api.github.com/users/gibson042","html_url":"https://github.com/gibson042","followers_url":"https://api.github.com/users/gibson042/followers","following_url":"https://api.github.com/users/gibson042/following{/other_user}","gists_url":"https://api.github.com/users/gibson042/gists{/gist_id}","starred_url":"https://api.github.com/users/gibson042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibson042/subscriptions","organizations_url":"https://api.github.com/users/gibson042/orgs","repos_url":"https://api.github.com/users/gibson042/repos","events_url":"https://api.github.com/users/gibson042/events{/privacy}","received_events_url":"https://api.github.com/users/gibson042/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T17:21:51Z","updated_at":"2016-12-02T17:21:51Z","body":"> I still don't understand. Why would BIND etc reject such a message?\r\n\r\nBecause it's invalid. The presentation-format data in my zone file specifies a record that cannot be expressed in wire format, so the nameservers refuse to load it.\r\n\r\n> Even so, you should be able to count the text elements after the parse and reject if it's larger than 1? This does not have to happing during the parse?\r\n\r\nThat won't work, because you're actually _transforming_ the input. For readability, let's assume the limit is 6 characters instead of 255 and consider the following records:\r\n```\r\nexample.com. 3600 IN TXT rdata abcdef ghijkl\t; 3 valid character-strings\r\nexample.com. 3600 IN TXT rdata abcdefghijkl\t; 1 valid character-string + 1 invalid\r\n```\r\nThis parser currently produces identical data structures for both records, forcing me to duplicate its efforts.\r\n\r\n> Depending on the details that might not work out so well as this library doesn't enforce length limits on domain names\r\n\r\nThat should be fixed as well, but I can at least check the length myself because input distinctiveness is preserved."}}
{"actor":{"display_login":"gibson042"}}