{"action":"created","issue":{"url":"https://api.github.com/repos/nghttp2/nghttp2/issues/581","repository_url":"https://api.github.com/repos/nghttp2/nghttp2","labels_url":"https://api.github.com/repos/nghttp2/nghttp2/issues/581/labels{/name}","comments_url":"https://api.github.com/repos/nghttp2/nghttp2/issues/581/comments","events_url":"https://api.github.com/repos/nghttp2/nghttp2/issues/581/events","html_url":"https://github.com/nghttp2/nghttp2/pull/581","id":150214250,"number":581,"title":"in nghttp2_session_send() data is declared uninitialized and used","user":{"login":"meconlen","id":3741292,"avatar_url":"https://avatars.githubusercontent.com/u/3741292?v=3","gravatar_id":"","url":"https://api.github.com/users/meconlen","html_url":"https://github.com/meconlen","followers_url":"https://api.github.com/users/meconlen/followers","following_url":"https://api.github.com/users/meconlen/following{/other_user}","gists_url":"https://api.github.com/users/meconlen/gists{/gist_id}","starred_url":"https://api.github.com/users/meconlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meconlen/subscriptions","organizations_url":"https://api.github.com/users/meconlen/orgs","repos_url":"https://api.github.com/users/meconlen/repos","events_url":"https://api.github.com/users/meconlen/events{/privacy}","received_events_url":"https://api.github.com/users/meconlen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T22:58:46Z","updated_at":"2016-04-22T14:31:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nghttp2/nghttp2/pulls/581","html_url":"https://github.com/nghttp2/nghttp2/pull/581","diff_url":"https://github.com/nghttp2/nghttp2/pull/581.diff","patch_url":"https://github.com/nghttp2/nghttp2/pull/581.patch"},"body":"The variable data is used possibly unset after a call to \r\nnghttp2_session_mem_send_internal() which should\r\nset it, however in nghttp2_session_mem_send_internal() it is\r\npossible to return before setting the pointer.\r\n\r\nThis change initializes the variable to NULL where delcared and\r\nsets the variable in nghttp2_session_mem_send_internal() to\r\nNULL before possibly returning rather than after.\r\n\r\nboth options are not necessary but are both ideal practice\r\n\r\nNote: this tickled the following compilation failure in gcc 4.8.4\r\n\r\nnghttp2_session.c: In function 'nghttp2_session_send':\r\nnghttp2_session.c:2942:13: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized]\r\n     sentlen = session->callbacks.send_callback(session, data, (size_t)datalen,\r\n             ^\r\ncc1: all warnings being treated as errors\r\n"},"comment":{"url":"https://api.github.com/repos/nghttp2/nghttp2/issues/comments/213449983","html_url":"https://github.com/nghttp2/nghttp2/pull/581#issuecomment-213449983","issue_url":"https://api.github.com/repos/nghttp2/nghttp2/issues/581","id":213449983,"user":{"login":"tatsuhiro-t","id":404610,"avatar_url":"https://avatars.githubusercontent.com/u/404610?v=3","gravatar_id":"","url":"https://api.github.com/users/tatsuhiro-t","html_url":"https://github.com/tatsuhiro-t","followers_url":"https://api.github.com/users/tatsuhiro-t/followers","following_url":"https://api.github.com/users/tatsuhiro-t/following{/other_user}","gists_url":"https://api.github.com/users/tatsuhiro-t/gists{/gist_id}","starred_url":"https://api.github.com/users/tatsuhiro-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatsuhiro-t/subscriptions","organizations_url":"https://api.github.com/users/tatsuhiro-t/orgs","repos_url":"https://api.github.com/users/tatsuhiro-t/repos","events_url":"https://api.github.com/users/tatsuhiro-t/events{/privacy}","received_events_url":"https://api.github.com/users/tatsuhiro-t/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T14:31:42Z","updated_at":"2016-04-22T14:31:42Z","body":"Thank you for the PR!  Could you check my comment in the patch?"}}