From: Peter S. <pe...@st...> - 2011-09-23 10:45:01
|
Dave Camarillo wrote: > In further reviewing the code that relates to unref_size, I see the > following: > > unref_list[unref_cur++] = dev; > if (unref_cur > unref_size) { > unref_size += 64; > unref_list = realloc(unref_list, unref_size*sizeof(libusb_device*)); > if (unref_list == NULL) { > usbi_err(ctx, "could not realloc list for unref - aborting."); > LOOP_BREAK(LIBUSB_ERROR_NO_MEM); > } > } > > I believe there is an off-by-one error in the above if conditional. .. > I believe that "if (unref_cur > unref_size) {" should be "if > (unref_cur >= unref_size) {". How does this sound to you? Sure. Does it work if you make that change? Can you send a patch for the libusb.git testing branch please? As you know we're making a release now. git clone -b testing http://git.libusb.org/libusb.git cd libusb git config user.name "Dave Camarillo" git config user.email edit libusb/os/windows_usb.c git commit libusb/os/windows_usb.c Write commit message (See http://libusb.org/wiki/Development/Commits ) Save commit message and exit editor git format-patch -1 Send 0001-* file to mailing list //Peter |