https://bugs.winehq.org/show_bug.cgi?id=37483
Bug ID: 37483 Summary: Possible null pointer dereference: lpItem - otherwise it is redundant to check it (Cppcheck) Product: Wine Version: 1.7.29 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: comctl32 Assignee: wine-bugs@winehq.org Reporter: 00cpxxx@gmail.com Distribution: ---
[dlls\comctl32\listview.c:4222] -> [dlls\comctl32\listview.c:4247]: (warning) Possible null pointer dereference: lpItem - otherwise it is redundant to check it
lpItem may be null but later it's used without check:
4193 if (infoPtr->dwStyle & LVS_OWNERDATA) 4194 { 4195 /* a virtual listview only stores selection and focus */ 4196 if (lpLVItem->mask & ~LVIF_STATE) 4197 return FALSE; 4198 lpItem = NULL; 4199 }
...
4222 if ((lpLVItem->mask & LVIF_IMAGE) && (lpItem->hdr.iImage != lpLVItem->iImage)) 4223 uChanged |= LVIF_IMAGE; 4224 4225 if ((lpLVItem->mask & LVIF_PARAM) && (lpItem->lParam != lpLVItem->lParam)) 4226 uChanged |= LVIF_PARAM;