)]}'
{
  "commit": "b2134bcd2e1bf989e0566dd1b0e59a792722b671",
  "tree": "20ae79f13afa14c0bee52c03daaae4e732af1417",
  "parents": [
    "99f83c9c9ac994c844ecf3e64e848c2f8dd7dfe0"
  ],
  "author": {
    "name": "KAMBAROV, ZAUR",
    "email": "kambarov@berkeley.edu",
    "time": "Fri Jun 24 22:20:35 2005 -0700"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@suse.de",
    "time": "Tue Jul 12 11:52:56 2005 -0700"
  },
  "message": "[PATCH] USB: coverity: (desc-\u003ebitmap)[] overrun fix\n\nThe length of the array desc-\u003ebitmap is 3, and not 4:\n\nDefinitions involved:\n\nIn drivers/usb/core/hcd.h\n\n464  \t#define bitmap \tDeviceRemovable\n\nIn drivers/usb/host/ohci-hub.c\n\n395  \t\tstruct usb_hub_descriptor\t*desc\n\nIn drivers/usb/core/hub.h\n\n130  \tstruct usb_hub_descriptor {\n131  \t\t__u8  bDescLength;\n132  \t\t__u8  bDescriptorType;\n133  \t\t__u8  bNbrPorts;\n134  \t\t__u16 wHubCharacteristics;\n135  \t\t__u8  bPwrOn2PwrGood;\n136  \t\t__u8  bHubContrCurrent;\n137  \t\t    \t/* add 1 bit for hub status change; round to bytes */\n138  \t\t__u8  DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];\n139  \t\t__u8  PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];\n140  \t} __attribute__ ((packed));\n\nIn include/linux/usb.h\n\n306  \t#define USB_MAXCHILDREN\t\t(16)\n\nThis defect was found automatically by Coverity Prevent, a static analysis\ntool.\n\n(akpm: this code should be shot.  Field `bitmap\u0027 doesn\u0027t exist in struct\nusb_hub_descriptor.  And this .c file is #included in\ndrivers/usb/host/ohci-hcd.c, and someone somewhere #defines `bitmap\u0027 to\n`DeviceRemovable\u0027.\n\n\u003eFrom a maintainability POV it would be better to memset the whole array\nbeforehand - I changed the patch to do that)\n\nSigned-off-by: Zaur Kambarov \u003czkambarov@coverity.com\u003e\nCc: \u003clinux-usb-devel@lists.sourceforge.net?\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e2fc4129dfc6e0f3684d3d5aee438ca4a0e85640",
      "old_mode": 33188,
      "old_path": "drivers/usb/host/ohci-hub.c",
      "new_id": "83ca4549a50ecac5f82504ba375419ad3c9b6d0a",
      "new_mode": 33188,
      "new_path": "drivers/usb/host/ohci-hub.c"
    }
  ]
}
