{"action":"created","comment":{"url":"https://api.github.com/repos/xapian/xapian/pulls/comments/23355446","id":23355446,"diff_hunk":"@@ -144,7 +147,19 @@ date_range_filter(const string & date_start, const string & date_end,\n {\n     int y1, m1, d1, y2, m2, d2;\n     if (!date_span.empty()) {\n-\ttime_t secs = atoi(date_span.c_str()) * (24 * 60 * 60);\n+\terrno = 0;\n+\tlong long str_to_longlong = strtoll(date_span.c_str(), NULL, 0);\n+\tif (errno == ERANGE) {\n+\t    switch (str_to_longlong) {\n+\t\tcase LLONG_MIN:\n+\t\t    throw (string(\"Date span underflow:\"));\n+\t\tcase LLONG_MAX:\n+\t\t    throw (string(\"Date span overflow:\"));\n+\t    }\n+\t}\n+\tif (time_t(str_to_longlong) > (numeric_limits<time_t>::max() / (24 * 60 * 60)))","path":"xapian-applications/omega/date.cc","position":25,"original_position":25,"commit_id":"5f5a20cacd50e4cc490ddf2e6b0aa0b40115f82e","original_commit_id":"5f5a20cacd50e4cc490ddf2e6b0aa0b40115f82e","user":{"login":"ojwb","id":164061,"avatar_url":"https://avatars.githubusercontent.com/u/164061?v=3","gravatar_id":"","url":"https://api.github.com/users/ojwb","html_url":"https://github.com/ojwb","followers_url":"https://api.github.com/users/ojwb/followers","following_url":"https://api.github.com/users/ojwb/following{/other_user}","gists_url":"https://api.github.com/users/ojwb/gists{/gist_id}","starred_url":"https://api.github.com/users/ojwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojwb/subscriptions","organizations_url":"https://api.github.com/users/ojwb/orgs","repos_url":"https://api.github.com/users/ojwb/repos","events_url":"https://api.github.com/users/ojwb/events{/privacy}","received_events_url":"https://api.github.com/users/ojwb/received_events","type":"User","site_admin":false},"body":"This check is incorrect for 32-bit time_t - e.g. when `str_to_longlong = 4294967296` it evaluates to `0 > 24855`.","created_at":"2015-01-22T04:48:57Z","updated_at":"2015-01-22T04:48:57Z","html_url":"https://github.com/xapian/xapian/pull/66#discussion_r23355446","pull_request_url":"https://api.github.com/repos/xapian/xapian/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments/23355446"},"html":{"href":"https://github.com/xapian/xapian/pull/66#discussion_r23355446"},"pull_request":{"href":"https://api.github.com/repos/xapian/xapian/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/xapian/xapian/pulls/66","id":26569127,"html_url":"https://github.com/xapian/xapian/pull/66","diff_url":"https://github.com/xapian/xapian/pull/66.diff","patch_url":"https://github.com/xapian/xapian/pull/66.patch","issue_url":"https://api.github.com/repos/xapian/xapian/issues/66","number":66,"state":"open","locked":false,"title":"Replace atoi with strtol: Initial Patch","user":{"login":"PriyankBhatt","id":8079399,"avatar_url":"https://avatars.githubusercontent.com/u/8079399?v=3","gravatar_id":"","url":"https://api.github.com/users/PriyankBhatt","html_url":"https://github.com/PriyankBhatt","followers_url":"https://api.github.com/users/PriyankBhatt/followers","following_url":"https://api.github.com/users/PriyankBhatt/following{/other_user}","gists_url":"https://api.github.com/users/PriyankBhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/PriyankBhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PriyankBhatt/subscriptions","organizations_url":"https://api.github.com/users/PriyankBhatt/orgs","repos_url":"https://api.github.com/users/PriyankBhatt/repos","events_url":"https://api.github.com/users/PriyankBhatt/events{/privacy}","received_events_url":"https://api.github.com/users/PriyankBhatt/received_events","type":"User","site_admin":false},"body":"1.Modified atoi with strtol and strtoll depending upon the system that is 32bit or 64bit. This will help to represent more year's with 64bit system and atlast ensuring that conversion of second's at last occurs in time_t format by type casting it.\r\n2.Also checked for underflow or overflow condition using errno variable.","created_at":"2014-12-24T21:23:56Z","updated_at":"2015-01-22T04:48:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c853a89e11c43fcdaef3851dc4c3f49d0498e8d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xapian/xapian/pulls/66/commits","review_comments_url":"https://api.github.com/repos/xapian/xapian/pulls/66/comments","review_comment_url":"https://api.github.com/repos/xapian/xapian/pulls/comments/{number}","comments_url":"https://api.github.com/repos/xapian/xapian/issues/66/comments","statuses_url":"https://api.github.com/repos/xapian/xapian/statuses/5f5a20cacd50e4cc490ddf2e6b0aa0b40115f82e","head":{"label":"PriyankBhatt:master","ref":"master","sha":"5f5a20cacd50e4cc490ddf2e6b0aa0b40115f82e","user":{"login":"PriyankBhatt","id":8079399,"avatar_url":"https://avatars.githubusercontent.com/u/8079399?v=3","gravatar_id":"","url":"https://api.github.com/users/PriyankBhatt","html_url":"https://github.com/PriyankBhatt","followers_url":"https://api.github.com/users/PriyankBhatt/followers","following_url":"https://api.github.com/users/PriyankBhatt/following{/other_user}","gists_url":"https://api.github.com/users/PriyankBhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/PriyankBhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PriyankBhatt/subscriptions","organizations_url":"https://api.github.com/users/PriyankBhatt/orgs","repos_url":"https://api.github.com/users/PriyankBhatt/repos","events_url":"https://api.github.com/users/PriyankBhatt/events{/privacy}","received_events_url":"https://api.github.com/users/PriyankBhatt/received_events","type":"User","site_admin":false},"repo":{"id":28461928,"name":"xapian","full_name":"PriyankBhatt/xapian","owner":{"login":"PriyankBhatt","id":8079399,"avatar_url":"https://avatars.githubusercontent.com/u/8079399?v=3","gravatar_id":"","url":"https://api.github.com/users/PriyankBhatt","html_url":"https://github.com/PriyankBhatt","followers_url":"https://api.github.com/users/PriyankBhatt/followers","following_url":"https://api.github.com/users/PriyankBhatt/following{/other_user}","gists_url":"https://api.github.com/users/PriyankBhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/PriyankBhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PriyankBhatt/subscriptions","organizations_url":"https://api.github.com/users/PriyankBhatt/orgs","repos_url":"https://api.github.com/users/PriyankBhatt/repos","events_url":"https://api.github.com/users/PriyankBhatt/events{/privacy}","received_events_url":"https://api.github.com/users/PriyankBhatt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PriyankBhatt/xapian","description":"Mirror of the Xapian repository.  You're welcome to open pull requests on github (they'll just get merged indirectly).","fork":true,"url":"https://api.github.com/repos/PriyankBhatt/xapian","forks_url":"https://api.github.com/repos/PriyankBhatt/xapian/forks","keys_url":"https://api.github.com/repos/PriyankBhatt/xapian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PriyankBhatt/xapian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PriyankBhatt/xapian/teams","hooks_url":"https://api.github.com/repos/PriyankBhatt/xapian/hooks","issue_events_url":"https://api.github.com/repos/PriyankBhatt/xapian/issues/events{/number}","events_url":"https://api.github.com/repos/PriyankBhatt/xapian/events","assignees_url":"https://api.github.com/repos/PriyankBhatt/xapian/assignees{/user}","branches_url":"https://api.github.com/repos/PriyankBhatt/xapian/branches{/branch}","tags_url":"https://api.github.com/repos/PriyankBhatt/xapian/tags","blobs_url":"https://api.github.com/repos/PriyankBhatt/xapian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PriyankBhatt/xapian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PriyankBhatt/xapian/git/refs{/sha}","trees_url":"https://api.github.com/repos/PriyankBhatt/xapian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PriyankBhatt/xapian/statuses/{sha}","languages_url":"https://api.github.com/repos/PriyankBhatt/xapian/languages","stargazers_url":"https://api.github.com/repos/PriyankBhatt/xapian/stargazers","contributors_url":"https://api.github.com/repos/PriyankBhatt/xapian/contributors","subscribers_url":"https://api.github.com/repos/PriyankBhatt/xapian/subscribers","subscription_url":"https://api.github.com/repos/PriyankBhatt/xapian/subscription","commits_url":"https://api.github.com/repos/PriyankBhatt/xapian/commits{/sha}","git_commits_url":"https://api.github.com/repos/PriyankBhatt/xapian/git/commits{/sha}","comments_url":"https://api.github.com/repos/PriyankBhatt/xapian/comments{/number}","issue_comment_url":"https://api.github.com/repos/PriyankBhatt/xapian/issues/comments/{number}","contents_url":"https://api.github.com/repos/PriyankBhatt/xapian/contents/{+path}","compare_url":"https://api.github.com/repos/PriyankBhatt/xapian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PriyankBhatt/xapian/merges","archive_url":"https://api.github.com/repos/PriyankBhatt/xapian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PriyankBhatt/xapian/downloads","issues_url":"https://api.github.com/repos/PriyankBhatt/xapian/issues{/number}","pulls_url":"https://api.github.com/repos/PriyankBhatt/xapian/pulls{/number}","milestones_url":"https://api.github.com/repos/PriyankBhatt/xapian/milestones{/number}","notifications_url":"https://api.github.com/repos/PriyankBhatt/xapian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PriyankBhatt/xapian/labels{/name}","releases_url":"https://api.github.com/repos/PriyankBhatt/xapian/releases{/id}","created_at":"2014-12-24T21:02:07Z","updated_at":"2015-01-18T18:43:19Z","pushed_at":"2015-01-18T18:43:19Z","git_url":"git://github.com/PriyankBhatt/xapian.git","ssh_url":"git@github.com:PriyankBhatt/xapian.git","clone_url":"https://github.com/PriyankBhatt/xapian.git","svn_url":"https://github.com/PriyankBhatt/xapian","homepage":"http://xapian.org/","size":49441,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"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":"xapian:master","ref":"master","sha":"b7815f26d0727070a24fbe3717893e423df786a2","user":{"login":"xapian","id":312861,"avatar_url":"https://avatars.githubusercontent.com/u/312861?v=3","gravatar_id":"","url":"https://api.github.com/users/xapian","html_url":"https://github.com/xapian","followers_url":"https://api.github.com/users/xapian/followers","following_url":"https://api.github.com/users/xapian/following{/other_user}","gists_url":"https://api.github.com/users/xapian/gists{/gist_id}","starred_url":"https://api.github.com/users/xapian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapian/subscriptions","organizations_url":"https://api.github.com/users/xapian/orgs","repos_url":"https://api.github.com/users/xapian/repos","events_url":"https://api.github.com/users/xapian/events{/privacy}","received_events_url":"https://api.github.com/users/xapian/received_events","type":"Organization","site_admin":false},"repo":{"id":735981,"name":"xapian","full_name":"xapian/xapian","owner":{"login":"xapian","id":312861,"avatar_url":"https://avatars.githubusercontent.com/u/312861?v=3","gravatar_id":"","url":"https://api.github.com/users/xapian","html_url":"https://github.com/xapian","followers_url":"https://api.github.com/users/xapian/followers","following_url":"https://api.github.com/users/xapian/following{/other_user}","gists_url":"https://api.github.com/users/xapian/gists{/gist_id}","starred_url":"https://api.github.com/users/xapian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapian/subscriptions","organizations_url":"https://api.github.com/users/xapian/orgs","repos_url":"https://api.github.com/users/xapian/repos","events_url":"https://api.github.com/users/xapian/events{/privacy}","received_events_url":"https://api.github.com/users/xapian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xapian/xapian","description":"Mirror of the Xapian repository.  You're welcome to open pull requests on github (they'll just get merged indirectly).","fork":false,"url":"https://api.github.com/repos/xapian/xapian","forks_url":"https://api.github.com/repos/xapian/xapian/forks","keys_url":"https://api.github.com/repos/xapian/xapian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xapian/xapian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xapian/xapian/teams","hooks_url":"https://api.github.com/repos/xapian/xapian/hooks","issue_events_url":"https://api.github.com/repos/xapian/xapian/issues/events{/number}","events_url":"https://api.github.com/repos/xapian/xapian/events","assignees_url":"https://api.github.com/repos/xapian/xapian/assignees{/user}","branches_url":"https://api.github.com/repos/xapian/xapian/branches{/branch}","tags_url":"https://api.github.com/repos/xapian/xapian/tags","blobs_url":"https://api.github.com/repos/xapian/xapian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xapian/xapian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xapian/xapian/git/refs{/sha}","trees_url":"https://api.github.com/repos/xapian/xapian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xapian/xapian/statuses/{sha}","languages_url":"https://api.github.com/repos/xapian/xapian/languages","stargazers_url":"https://api.github.com/repos/xapian/xapian/stargazers","contributors_url":"https://api.github.com/repos/xapian/xapian/contributors","subscribers_url":"https://api.github.com/repos/xapian/xapian/subscribers","subscription_url":"https://api.github.com/repos/xapian/xapian/subscription","commits_url":"https://api.github.com/repos/xapian/xapian/commits{/sha}","git_commits_url":"https://api.github.com/repos/xapian/xapian/git/commits{/sha}","comments_url":"https://api.github.com/repos/xapian/xapian/comments{/number}","issue_comment_url":"https://api.github.com/repos/xapian/xapian/issues/comments/{number}","contents_url":"https://api.github.com/repos/xapian/xapian/contents/{+path}","compare_url":"https://api.github.com/repos/xapian/xapian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xapian/xapian/merges","archive_url":"https://api.github.com/repos/xapian/xapian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xapian/xapian/downloads","issues_url":"https://api.github.com/repos/xapian/xapian/issues{/number}","pulls_url":"https://api.github.com/repos/xapian/xapian/pulls{/number}","milestones_url":"https://api.github.com/repos/xapian/xapian/milestones{/number}","notifications_url":"https://api.github.com/repos/xapian/xapian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xapian/xapian/labels{/name}","releases_url":"https://api.github.com/repos/xapian/xapian/releases{/id}","created_at":"2010-06-23T15:51:03Z","updated_at":"2015-01-22T01:45:03Z","pushed_at":"2015-01-22T01:44:59Z","git_url":"git://github.com/xapian/xapian.git","ssh_url":"git@github.com:xapian/xapian.git","clone_url":"https://github.com/xapian/xapian.git","svn_url":"https://github.com/xapian/xapian","homepage":"http://xapian.org/","size":71218,"stargazers_count":158,"watchers_count":158,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":91,"mirror_url":null,"open_issues_count":12,"forks":91,"open_issues":12,"watchers":158,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/66"},"html":{"href":"https://github.com/xapian/xapian/pull/66"},"issue":{"href":"https://api.github.com/repos/xapian/xapian/issues/66"},"comments":{"href":"https://api.github.com/repos/xapian/xapian/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/xapian/xapian/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/xapian/xapian/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/xapian/xapian/statuses/5f5a20cacd50e4cc490ddf2e6b0aa0b40115f82e"}}}}