TOSMBClient
TOSMBClient copied to clipboard
Connection error not handled correctly in requestContentsOfDirectoryAtFilePath
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.
Oh! Nicely spotted! Thanks! I'll need to fix that when I get the chance.