Skip to content

Commit 28667b6

Browse files
author
Joerg Wunsch
committed
Test product_string not nullptr before comparison
This happens to be the case on Raspberry Pi, for whatever reason. git-svn-id: svn://svn.code.sf.net/p/avarice/code/trunk/avarice@423 a7e36acc-7495-4a18-91ca-7b9a7881be12
1 parent ecfcedf commit 28667b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/jtag2usb.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,8 @@ static hid_device *openhid(const char *jtagDeviceName, unsigned int &max_pkt_siz
643643
walk = list;
644644
while (walk)
645645
{
646-
if (wcsstr(walk->product_string, L"CMSIS-DAP") != NULL)
646+
if (walk->product_string != nullptr &&
647+
wcsstr(walk->product_string, L"CMSIS-DAP") != NULL)
647648
{
648649
debugOut("Found HID PID:VID 0x%04x:0x%04x, serno %ls\n",
649650
walk->vendor_id, walk->product_id,

0 commit comments

Comments
 (0)