#4 Not checking return value for IOCtl()

closed-fixed
nobody
None
5
2001-06-05
2001-06-02
Philip Van Baren
No

In cddb.cpp, the m_Socket.IOCtl() function's return
value is not checked. If this function fails, then
nRead is not initialized, and you could get a very
long while(nRead--) loop. Here is a patch to fix the
bug:

diff -r1.23 Cddb.cpp
148c148
< DWORD nRead;
---
> DWORD nRead=0;
155,157c155
< m_Socket.IOCtl(FIONREAD, &nRead);
<
< if (nRead)
---
> if (m_Socket.IOCtl(FIONREAD, &nRead)
&& nRead)

Discussion

    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=131228

    Fixed in cddb.cpp version 1.24