Module: wine Branch: master Commit: 47d1fee7fc4964edebbb735fa3f3e111194c4f13 URL: http://source.winehq.org/git/wine.git/?a=commit;h=47d1fee7fc4964edebbb735fa3... Author: Rok Mandeljc <manrok(a)email.si> Date: Thu Nov 1 08:09:33 2007 +0100 wnaspi32: Fix controller number validation. --- dlls/wnaspi32/winaspi32.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/wnaspi32/winaspi32.c b/dlls/wnaspi32/winaspi32.c index 8c76878..438b2a1 100644 --- a/dlls/wnaspi32/winaspi32.c +++ b/dlls/wnaspi32/winaspi32.c @@ -109,7 +109,7 @@ ASPI_OpenDevice(SRB_ExecSCSICmd *prb) } LeaveCriticalSection(&ASPI_CritSection); - if (prb->SRB_HaId > ASPI_GetNumControllers()) + if (prb->SRB_HaId >= ASPI_GetNumControllers()) return -1; hc = ASPI_GetHCforController( prb->SRB_HaId ); @@ -314,8 +314,8 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB) DWORD SRB_Status; num_controllers = ASPI_GetNumControllers(); - if (lpPRB->SRB_HaId > num_controllers) { - WARN("Failed: Wanted hostadapter %d, but we have only %d.\n", + if (lpPRB->SRB_HaId >= num_controllers) { + WARN("Failed: Wanted hostadapter with index %d, but we have only %d.\n", lpPRB->SRB_HaId, num_controllers ); return WNASPI32_DoPosting( lpPRB, SS_INVALID_HA );