diff --git a/go.mod b/go.mod index 8c3c9b409a..ba99e62787 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/influxdata/influxdb v0.0.0-20180221223340-01288bdb0883 // indirect github.com/jackpal/go-nat-pmp v0.0.0-20160603034137-1fa385a6f458 // indirect github.com/json-iterator/go v1.1.7 // indirect - github.com/karalabe/usb v0.0.0-20190819132248-550797b1cad8 // indirect + github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/mattn/go-colorable v0.1.2 diff --git a/go.sum b/go.sum index 758f260483..fdcd4b417d 100644 --- a/go.sum +++ b/go.sum @@ -141,8 +141,8 @@ github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62F github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/karalabe/usb v0.0.0-20190819132248-550797b1cad8 h1:VhnqxaTIudc9IWKx8uXRLnpdSb9noCEj+vHacjmhp68= -github.com/karalabe/usb v0.0.0-20190819132248-550797b1cad8/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= diff --git a/vendor/github.com/karalabe/usb/hidapi/windows/hid.c b/vendor/github.com/karalabe/usb/hidapi/windows/hid.c index 4e92cc8bc9..60da64608c 100644 --- a/vendor/github.com/karalabe/usb/hidapi/windows/hid.c +++ b/vendor/github.com/karalabe/usb/hidapi/windows/hid.c @@ -74,6 +74,8 @@ extern "C" { #pragma warning(disable:4996) #endif +#pragma GCC diagnostic ignored "-Wstringop-overflow" + #ifdef __cplusplus extern "C" { #endif @@ -428,7 +430,7 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor if (str) { len = strlen(str); cur_dev->path = (char*) calloc(len+1, sizeof(char)); - strncpy(cur_dev->path, str, sizeof(cur_dev->path)); + strncpy(cur_dev->path, str, len+1); cur_dev->path[len] = '\0'; } else diff --git a/vendor/modules.txt b/vendor/modules.txt index a3e724a59f..f3365391c3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -248,7 +248,7 @@ github.com/jackpal/go-nat-pmp github.com/json-iterator/go # github.com/julienschmidt/httprouter v1.2.0 github.com/julienschmidt/httprouter -# github.com/karalabe/usb v0.0.0-20190819132248-550797b1cad8 +# github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 github.com/karalabe/usb # github.com/konsorten/go-windows-terminal-sequences v1.0.2 github.com/konsorten/go-windows-terminal-sequences