Skip to content

Connection error not handled correctly in requestContentsOfDirectoryAtFilePath #54

@jimkeir

Description

@jimkeir

Hardware / Software

Which version of the library were you using?
1.0.8, from pod

Which version of iOS are you running?
11

What model of iOS device were you testing on?
iPad Air 2

If using CocoaPods, which version of CocoaPods are you on?
1.3.1

In TOSMBSession.m, lines 291-3 are:
smb_tid shareID = -1;
smb_tree_connect(self.session, cStringName, &shareID);
if (shareID < 0) {

The bundled version of smb_share.h declares shareID as smb_tid, and smb_types.h declares this as uint16_t . The comparison "shareID < 0" is never true, because the range of values of uint16_t is 0 -> 65535 . Use the return code of smb_tree_connect, which is signed int, instead of the smb_tid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions