• Wim Van Sebroeck's avatar
    watchdog: cpwd: Fix buffer-overflow · bbd562d7
    Wim Van Sebroeck authored
    cppcheck-1.47 reports:
    [drivers/watchdog/cpwd.c:650]: (error) Buffer access out-of-bounds: p.devs
    
    The source code is
    	for (i = 0; i < 4; i++) {
    		misc_deregister(&p->devs[i].misc);
    
    where devs is defined as WD_NUMDEVS big and WD_NUMDEVS is equal to 3.
    So the 4 should be a 3 or WD_NUMDEVS.
    
    Reported-By: David Binderman
    Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
    bbd562d7
cpwd.c 16.3 KB