diff options
| author | Andrew Chant <achant@google.com> | 2018-06-26 10:52:23 -0700 |
|---|---|---|
| committer | Andrew Chant <achant@google.com> | 2018-06-26 10:54:55 -0700 |
| commit | d7f8ee71bbdbe04a0f7950c24fe6ec83151b808a (patch) | |
| tree | 5fdf4d98505165bf770bf2fce4dfe343bef62068 /usb | |
| parent | 80c6eea03fa85a01e5b78b51ca8a30b55c47ce68 (diff) | |
crosshatch: usb: fix unchecked string access
Fix strcmp of a string without checking to see
if it's not null.
Bug: 110808261
Change-Id: I9782e57b96873c4bea37626dc49f0da34876b2b4
Signed-off-by: Andrew Chant <achant@google.com>
Diffstat (limited to 'usb')
| -rw-r--r-- | usb/Usb.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usb/Usb.cpp b/usb/Usb.cpp index 5b28b19..41039f7 100644 --- a/usb/Usb.cpp +++ b/usb/Usb.cpp @@ -601,7 +601,7 @@ static void reportUsbAudioUevents(struct data *payload, const char* driver, cons client->reportUsbAudioConnected(vid, pid); payload->attachedProduct = strdup(product); } else if (!strcmp(action, "ACTION=remove")) { - if (strcmp(payload->attachedProduct, product)) { + if (!payload->attachedProduct || strcmp(payload->attachedProduct, product)) { return; } free(payload->attachedProduct); |
