You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When NULL is not checked, passing NULL pointer causes crash when attempting to dereference nData->dir. As far as int FtpClose(ftphandle *nData); is not internal function, the argument passed cannot be guaranteed.
/*
* FtpClose - close a data connection
*/
int ftplib::FtpClose(ftphandle *nData)
{
ftphandle *ctrl;
if (nData->dir == FTPLIB_WRITE)
{
if (nData->buf != NULL) writeline(NULL, 0, nData);
}
else if (nData->dir != FTPLIB_READ) return 0;
if (nData->buf) free(nData->buf);
shutdown(nData->handle,2);
net_close(nData->handle);
Please add NULL pointer checking here:
/*
* FtpClose - close a data connection
*/
int ftplib::FtpClose(ftphandle *nData)
{
ftphandle *ctrl;
if (nData==NULL) return 0;
if (nData->dir == FTPLIB_WRITE)
{
if (nData->buf != NULL) writeline(NULL, 0, nData);
}
The text was updated successfully, but these errors were encountered:
When NULL is not checked, passing NULL pointer causes crash when attempting to dereference nData->dir. As far as int FtpClose(ftphandle *nData); is not internal function, the argument passed cannot be guaranteed.
Please add NULL pointer checking here:
The text was updated successfully, but these errors were encountered: