{"action":"created","comment":{"url":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments/35222231","id":35222231,"diff_hunk":"@@ -127,7 +127,18 @@ static int blob_iterate_callback_common(struct eblob_disk_control *dc, int fd, u\n \t\t}\n \n \t\tdata_offset += sizeof(struct dnet_ext_list_hdr);\n-\t\tsize -= sizeof(struct dnet_ext_list_hdr);\n+\n+\t\t/*\n+\t\t * When record is not yet committed (it was allocated on disk via write_prepare and optional write_plain),\n+\t\t * its @data_size is zero and removing this header size ends up with negative size converted back to\n+\t\t * very large positive number (0xffffffffffffffd0)\n+\t\t *\n+\t\t * @data_offset above is safe, since actually eblob had allocated all needed space,\n+\t\t * it just hasn't yet filled eblob_disk_control\n+\t\t */\n+\t\tif (!(dc->flags & BLOB_DISK_CTL_UNCOMMITTED)) {\n+\t\t\tsize -= sizeof(struct dnet_ext_list_hdr);","path":"example/eblob_backend.c","position":15,"original_position":15,"commit_id":"0142cdd95ef8307ac50727340d2aec126eaf0c9b","original_commit_id":"c4c8cf82f72da732131f29a306e38f3e62a61648","user":{"login":"shaitan","id":446423,"avatar_url":"https://avatars.githubusercontent.com/u/446423?v=3","gravatar_id":"","url":"https://api.github.com/users/shaitan","html_url":"https://github.com/shaitan","followers_url":"https://api.github.com/users/shaitan/followers","following_url":"https://api.github.com/users/shaitan/following{/other_user}","gists_url":"https://api.github.com/users/shaitan/gists{/gist_id}","starred_url":"https://api.github.com/users/shaitan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaitan/subscriptions","organizations_url":"https://api.github.com/users/shaitan/orgs","repos_url":"https://api.github.com/users/shaitan/repos","events_url":"https://api.github.com/users/shaitan/events{/privacy}","received_events_url":"https://api.github.com/users/shaitan/received_events","type":"User","site_admin":false},"body":"I agree, but isn't it better to check the size before reading ext header? If old data was written without ext header what header will we read?","created_at":"2015-07-22T14:58:57Z","updated_at":"2015-07-22T14:58:57Z","html_url":"https://github.com/reverbrain/elliptics/pull/637#discussion_r35222231","pull_request_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/637","_links":{"self":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments/35222231"},"html":{"href":"https://github.com/reverbrain/elliptics/pull/637#discussion_r35222231"},"pull_request":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/637"}}},"pull_request":{"url":"https://api.github.com/repos/reverbrain/elliptics/pulls/637","id":40497647,"html_url":"https://github.com/reverbrain/elliptics/pull/637","diff_url":"https://github.com/reverbrain/elliptics/pull/637.diff","patch_url":"https://github.com/reverbrain/elliptics/pull/637.patch","issue_url":"https://api.github.com/repos/reverbrain/elliptics/issues/637","number":637,"state":"open","locked":false,"title":"eblob: fixed integer overflow for uncommitted records during iteration","user":{"login":"bioothod","id":1847575,"avatar_url":"https://avatars.githubusercontent.com/u/1847575?v=3","gravatar_id":"","url":"https://api.github.com/users/bioothod","html_url":"https://github.com/bioothod","followers_url":"https://api.github.com/users/bioothod/followers","following_url":"https://api.github.com/users/bioothod/following{/other_user}","gists_url":"https://api.github.com/users/bioothod/gists{/gist_id}","starred_url":"https://api.github.com/users/bioothod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bioothod/subscriptions","organizations_url":"https://api.github.com/users/bioothod/orgs","repos_url":"https://api.github.com/users/bioothod/repos","events_url":"https://api.github.com/users/bioothod/events{/privacy}","received_events_url":"https://api.github.com/users/bioothod/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-21T19:56:36Z","updated_at":"2015-07-22T14:58:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7874fa129b9d55dc5898226b9868a395e9f9125c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/637/commits","review_comments_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/637/comments","review_comment_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reverbrain/elliptics/issues/637/comments","statuses_url":"https://api.github.com/repos/reverbrain/elliptics/statuses/0142cdd95ef8307ac50727340d2aec126eaf0c9b","head":{"label":"bioothod:master","ref":"master","sha":"0142cdd95ef8307ac50727340d2aec126eaf0c9b","user":{"login":"bioothod","id":1847575,"avatar_url":"https://avatars.githubusercontent.com/u/1847575?v=3","gravatar_id":"","url":"https://api.github.com/users/bioothod","html_url":"https://github.com/bioothod","followers_url":"https://api.github.com/users/bioothod/followers","following_url":"https://api.github.com/users/bioothod/following{/other_user}","gists_url":"https://api.github.com/users/bioothod/gists{/gist_id}","starred_url":"https://api.github.com/users/bioothod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bioothod/subscriptions","organizations_url":"https://api.github.com/users/bioothod/orgs","repos_url":"https://api.github.com/users/bioothod/repos","events_url":"https://api.github.com/users/bioothod/events{/privacy}","received_events_url":"https://api.github.com/users/bioothod/received_events","type":"User","site_admin":false},"repo":{"id":34638202,"name":"elliptics","full_name":"bioothod/elliptics","owner":{"login":"bioothod","id":1847575,"avatar_url":"https://avatars.githubusercontent.com/u/1847575?v=3","gravatar_id":"","url":"https://api.github.com/users/bioothod","html_url":"https://github.com/bioothod","followers_url":"https://api.github.com/users/bioothod/followers","following_url":"https://api.github.com/users/bioothod/following{/other_user}","gists_url":"https://api.github.com/users/bioothod/gists{/gist_id}","starred_url":"https://api.github.com/users/bioothod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bioothod/subscriptions","organizations_url":"https://api.github.com/users/bioothod/orgs","repos_url":"https://api.github.com/users/bioothod/repos","events_url":"https://api.github.com/users/bioothod/events{/privacy}","received_events_url":"https://api.github.com/users/bioothod/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bioothod/elliptics","description":"Distributed hashtable storage","fork":true,"url":"https://api.github.com/repos/bioothod/elliptics","forks_url":"https://api.github.com/repos/bioothod/elliptics/forks","keys_url":"https://api.github.com/repos/bioothod/elliptics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bioothod/elliptics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bioothod/elliptics/teams","hooks_url":"https://api.github.com/repos/bioothod/elliptics/hooks","issue_events_url":"https://api.github.com/repos/bioothod/elliptics/issues/events{/number}","events_url":"https://api.github.com/repos/bioothod/elliptics/events","assignees_url":"https://api.github.com/repos/bioothod/elliptics/assignees{/user}","branches_url":"https://api.github.com/repos/bioothod/elliptics/branches{/branch}","tags_url":"https://api.github.com/repos/bioothod/elliptics/tags","blobs_url":"https://api.github.com/repos/bioothod/elliptics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bioothod/elliptics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bioothod/elliptics/git/refs{/sha}","trees_url":"https://api.github.com/repos/bioothod/elliptics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bioothod/elliptics/statuses/{sha}","languages_url":"https://api.github.com/repos/bioothod/elliptics/languages","stargazers_url":"https://api.github.com/repos/bioothod/elliptics/stargazers","contributors_url":"https://api.github.com/repos/bioothod/elliptics/contributors","subscribers_url":"https://api.github.com/repos/bioothod/elliptics/subscribers","subscription_url":"https://api.github.com/repos/bioothod/elliptics/subscription","commits_url":"https://api.github.com/repos/bioothod/elliptics/commits{/sha}","git_commits_url":"https://api.github.com/repos/bioothod/elliptics/git/commits{/sha}","comments_url":"https://api.github.com/repos/bioothod/elliptics/comments{/number}","issue_comment_url":"https://api.github.com/repos/bioothod/elliptics/issues/comments{/number}","contents_url":"https://api.github.com/repos/bioothod/elliptics/contents/{+path}","compare_url":"https://api.github.com/repos/bioothod/elliptics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bioothod/elliptics/merges","archive_url":"https://api.github.com/repos/bioothod/elliptics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bioothod/elliptics/downloads","issues_url":"https://api.github.com/repos/bioothod/elliptics/issues{/number}","pulls_url":"https://api.github.com/repos/bioothod/elliptics/pulls{/number}","milestones_url":"https://api.github.com/repos/bioothod/elliptics/milestones{/number}","notifications_url":"https://api.github.com/repos/bioothod/elliptics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bioothod/elliptics/labels{/name}","releases_url":"https://api.github.com/repos/bioothod/elliptics/releases{/id}","created_at":"2015-04-27T00:42:00Z","updated_at":"2015-05-05T22:34:45Z","pushed_at":"2015-07-22T14:48:10Z","git_url":"git://github.com/bioothod/elliptics.git","ssh_url":"git@github.com:bioothod/elliptics.git","clone_url":"https://github.com/bioothod/elliptics.git","svn_url":"https://github.com/bioothod/elliptics","homepage":null,"size":19900,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"reverbrain:master","ref":"master","sha":"cdada562ab7a2f44465f08182151b0466a4a79de","user":{"login":"reverbrain","id":1616511,"avatar_url":"https://avatars.githubusercontent.com/u/1616511?v=3","gravatar_id":"","url":"https://api.github.com/users/reverbrain","html_url":"https://github.com/reverbrain","followers_url":"https://api.github.com/users/reverbrain/followers","following_url":"https://api.github.com/users/reverbrain/following{/other_user}","gists_url":"https://api.github.com/users/reverbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/reverbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reverbrain/subscriptions","organizations_url":"https://api.github.com/users/reverbrain/orgs","repos_url":"https://api.github.com/users/reverbrain/repos","events_url":"https://api.github.com/users/reverbrain/events{/privacy}","received_events_url":"https://api.github.com/users/reverbrain/received_events","type":"Organization","site_admin":false},"repo":{"id":4712089,"name":"elliptics","full_name":"reverbrain/elliptics","owner":{"login":"reverbrain","id":1616511,"avatar_url":"https://avatars.githubusercontent.com/u/1616511?v=3","gravatar_id":"","url":"https://api.github.com/users/reverbrain","html_url":"https://github.com/reverbrain","followers_url":"https://api.github.com/users/reverbrain/followers","following_url":"https://api.github.com/users/reverbrain/following{/other_user}","gists_url":"https://api.github.com/users/reverbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/reverbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reverbrain/subscriptions","organizations_url":"https://api.github.com/users/reverbrain/orgs","repos_url":"https://api.github.com/users/reverbrain/repos","events_url":"https://api.github.com/users/reverbrain/events{/privacy}","received_events_url":"https://api.github.com/users/reverbrain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reverbrain/elliptics","description":"Distributed storage for medium and large objects with streaming support","fork":false,"url":"https://api.github.com/repos/reverbrain/elliptics","forks_url":"https://api.github.com/repos/reverbrain/elliptics/forks","keys_url":"https://api.github.com/repos/reverbrain/elliptics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reverbrain/elliptics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reverbrain/elliptics/teams","hooks_url":"https://api.github.com/repos/reverbrain/elliptics/hooks","issue_events_url":"https://api.github.com/repos/reverbrain/elliptics/issues/events{/number}","events_url":"https://api.github.com/repos/reverbrain/elliptics/events","assignees_url":"https://api.github.com/repos/reverbrain/elliptics/assignees{/user}","branches_url":"https://api.github.com/repos/reverbrain/elliptics/branches{/branch}","tags_url":"https://api.github.com/repos/reverbrain/elliptics/tags","blobs_url":"https://api.github.com/repos/reverbrain/elliptics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reverbrain/elliptics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reverbrain/elliptics/git/refs{/sha}","trees_url":"https://api.github.com/repos/reverbrain/elliptics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reverbrain/elliptics/statuses/{sha}","languages_url":"https://api.github.com/repos/reverbrain/elliptics/languages","stargazers_url":"https://api.github.com/repos/reverbrain/elliptics/stargazers","contributors_url":"https://api.github.com/repos/reverbrain/elliptics/contributors","subscribers_url":"https://api.github.com/repos/reverbrain/elliptics/subscribers","subscription_url":"https://api.github.com/repos/reverbrain/elliptics/subscription","commits_url":"https://api.github.com/repos/reverbrain/elliptics/commits{/sha}","git_commits_url":"https://api.github.com/repos/reverbrain/elliptics/git/commits{/sha}","comments_url":"https://api.github.com/repos/reverbrain/elliptics/comments{/number}","issue_comment_url":"https://api.github.com/repos/reverbrain/elliptics/issues/comments{/number}","contents_url":"https://api.github.com/repos/reverbrain/elliptics/contents/{+path}","compare_url":"https://api.github.com/repos/reverbrain/elliptics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reverbrain/elliptics/merges","archive_url":"https://api.github.com/repos/reverbrain/elliptics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reverbrain/elliptics/downloads","issues_url":"https://api.github.com/repos/reverbrain/elliptics/issues{/number}","pulls_url":"https://api.github.com/repos/reverbrain/elliptics/pulls{/number}","milestones_url":"https://api.github.com/repos/reverbrain/elliptics/milestones{/number}","notifications_url":"https://api.github.com/repos/reverbrain/elliptics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reverbrain/elliptics/labels{/name}","releases_url":"https://api.github.com/repos/reverbrain/elliptics/releases{/id}","created_at":"2012-06-19T10:05:10Z","updated_at":"2015-07-13T16:46:55Z","pushed_at":"2015-07-22T14:48:11Z","git_url":"git://github.com/reverbrain/elliptics.git","ssh_url":"git@github.com:reverbrain/elliptics.git","clone_url":"https://github.com/reverbrain/elliptics.git","svn_url":"https://github.com/reverbrain/elliptics","homepage":"http://reverbrain.com/elliptics","size":27760,"stargazers_count":334,"watchers_count":334,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":18,"forks":59,"open_issues":18,"watchers":334,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/637"},"html":{"href":"https://github.com/reverbrain/elliptics/pull/637"},"issue":{"href":"https://api.github.com/repos/reverbrain/elliptics/issues/637"},"comments":{"href":"https://api.github.com/repos/reverbrain/elliptics/issues/637/comments"},"review_comments":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/637/comments"},"review_comment":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/637/commits"},"statuses":{"href":"https://api.github.com/repos/reverbrain/elliptics/statuses/0142cdd95ef8307ac50727340d2aec126eaf0c9b"}}}}