{"action":"created","issue":{"url":"https://api.github.com/repos/OpenBazaar/openbazaar-go/issues/497","repository_url":"https://api.github.com/repos/OpenBazaar/openbazaar-go","labels_url":"https://api.github.com/repos/OpenBazaar/openbazaar-go/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/OpenBazaar/openbazaar-go/issues/497/comments","events_url":"https://api.github.com/repos/OpenBazaar/openbazaar-go/issues/497/events","html_url":"https://github.com/OpenBazaar/openbazaar-go/issues/497","id":220651218,"number":497,"title":"Missing error checks and other issues","user":{"login":"JustinDrake","id":731743,"avatar_url":"https://avatars2.githubusercontent.com/u/731743?v=3","gravatar_id":"","url":"https://api.github.com/users/JustinDrake","html_url":"https://github.com/JustinDrake","followers_url":"https://api.github.com/users/JustinDrake/followers","following_url":"https://api.github.com/users/JustinDrake/following{/other_user}","gists_url":"https://api.github.com/users/JustinDrake/gists{/gist_id}","starred_url":"https://api.github.com/users/JustinDrake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustinDrake/subscriptions","organizations_url":"https://api.github.com/users/JustinDrake/orgs","repos_url":"https://api.github.com/users/JustinDrake/repos","events_url":"https://api.github.com/users/JustinDrake/events{/privacy}","received_events_url":"https://api.github.com/users/JustinDrake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-10T13:51:36Z","updated_at":"2017-04-10T13:55:39Z","closed_at":null,"body":"Below are missing error checks. For illustration, the following function in followers.go has 4 unchecked errors:\r\n\r\n```\r\nfunc (f *FollowerDB) Put(follower string) error {\r\n\tf.lock.Lock()\r\n\tdefer f.lock.Unlock()\r\n\ttx, _ := f.db.Begin()  // ??? Missing error check!\r\n\tstmt, _ := tx.Prepare(\"insert into followers(peerID) values(?)\")  // ??? Missing error check!\r\n\r\n\tdefer stmt.Close()\r\n\t_, err := stmt.Exec(follower)\r\n\tif err != nil {\r\n\t\ttx.Rollback() // ??? Missing error check!\r\n\t\treturn err\r\n\t}\r\n\ttx.Commit() // ??? Missing error check!\r\n\treturn nil\r\n}\r\n```\r\n\r\n```\r\nbitcoin/bitcoind/wallet.go:113::warning: Subprocess launching with variable.,HIGH,HIGH (gas)\r\nbitcoin/bitcoind/wallet.go:588::warning: Subprocess launching with variable.,HIGH,HIGH (gas)\r\nnet/tor.go:33::warning: RSA keys should be at least 2048 bits,MEDIUM,HIGH (gas)\r\nrepo/init.go:136::warning: Expect directory permissions to be 0700 or less,MEDIUM,HIGH (gas)\r\nrepo/db/db.go:374::warning: Potential hardcoded credentials,HIGH,LOW (gas)\r\nrepo/db/followers.go:17::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/followers.go:18::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/followers.go:23::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/followers.go:26::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/followers.go:48::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/followers.go:57::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/followers.go:66::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:17::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:18::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:22::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:25::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:38::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:43::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:52::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/following.go:61::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/inventory.go:16::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/inventory.go:24::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/inventory.go:27::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/inventory.go:65::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/inventory.go:86::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/moderatedstores.go:17::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/moderatedstores.go:18::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/moderatedstores.go:23::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/moderatedstores.go:26::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/moderatedstores.go:48::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/moderatedstores.go:57::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/offinemessages.go:28::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/offinemessages.go:31::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/watched_scripts.go:17::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/watched_scripts.go:20::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/watched_scripts.go:26::warning: Errors unhandled.,LOW,HIGH (gas)\r\nrepo/db/watched_scripts.go:29::warning: Errors unhandled.,LOW,HIGH (gas)\r\napi/notifications/notifications.go:265::warning: Errors unhandled.,LOW,HIGH (gas)\r\napi/notifications/notifications.go:271::warning: Errors unhandled.,LOW,HIGH (gas)\r\napi/notifications/notifications.go:277::warning: Errors unhandled.,LOW,HIGH (gas)\r\napi/notifications/notifications.go:283::warning: Errors unhandled.,LOW,HIGH (gas)\r\napi/notifications/notifications.go:289::warning: Errors unhandled.,LOW,HIGH (gas)\r\napi/notifications/notifications.go:295::warning: Errors unhandled.,LOW,HIGH (gas)\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OpenBazaar/openbazaar-go/issues/comments/292956382","html_url":"https://github.com/OpenBazaar/openbazaar-go/issues/497#issuecomment-292956382","issue_url":"https://api.github.com/repos/OpenBazaar/openbazaar-go/issues/497","id":292956382,"user":{"login":"hoffmabc","id":45482,"avatar_url":"https://avatars3.githubusercontent.com/u/45482?v=3","gravatar_id":"","url":"https://api.github.com/users/hoffmabc","html_url":"https://github.com/hoffmabc","followers_url":"https://api.github.com/users/hoffmabc/followers","following_url":"https://api.github.com/users/hoffmabc/following{/other_user}","gists_url":"https://api.github.com/users/hoffmabc/gists{/gist_id}","starred_url":"https://api.github.com/users/hoffmabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoffmabc/subscriptions","organizations_url":"https://api.github.com/users/hoffmabc/orgs","repos_url":"https://api.github.com/users/hoffmabc/repos","events_url":"https://api.github.com/users/hoffmabc/events{/privacy}","received_events_url":"https://api.github.com/users/hoffmabc/received_events","type":"User","site_admin":false},"created_at":"2017-04-10T13:55:39Z","updated_at":"2017-04-10T13:55:39Z","body":"What does (gas) indicate here?"}}
{"actor":{"display_login":"hoffmabc"}}