Fix some possible NULL dereferences.
Этот коммит содержится в:
родитель
40c35f02c5
Коммит
3bab5199aa
@ -1,5 +1,6 @@
|
||||
2002-09-13 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* (get_stat_info): Fix some possible NULL dereferences.
|
||||
* smbfs.c (smbfs_set_debugf): New function to specify
|
||||
logfile.
|
||||
* smbfs.h: Declare smbfs_set_debugf().
|
||||
|
23
vfs/smbfs.c
23
vfs/smbfs.c
@ -1348,7 +1348,8 @@ get_stat_info (smbfs_connection *sc, char *path, struct stat *buf)
|
||||
mypath, current_info->dirname));
|
||||
#if 0
|
||||
if (!dentry) {
|
||||
DEBUG(1, ("No dir entries (empty dir) cached:'%s', wanted:'%s'\n", current_info->dirname, path));
|
||||
DEBUG (1, ("No dir entries (empty dir) cached:'%s', wanted:'%s'\n",
|
||||
current_info->dirname, path));
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@ -1394,21 +1395,29 @@ get_stat_info (smbfs_connection *sc, char *path, struct stat *buf)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
DEBUG(3, ("'%s' not found in current_info '%s'\n", path, current_info->dirname));
|
||||
DEBUG (3, ("'%s' not found in current_info '%s'\n", path,
|
||||
current_info->dirname));
|
||||
/* try to find this in the PREVIOUS listing */
|
||||
if (previous_info) {
|
||||
if (search_dir_entry (previous_info->entries, mypath, buf) == 0)
|
||||
return 0;
|
||||
DEBUG(3, ("'%s' not found in previous_info '%s'\n", path, previous_info->dirname));
|
||||
DEBUG (3, ("'%s' not found in previous_info '%s'\n", path,
|
||||
previous_info->dirname));
|
||||
}
|
||||
/* try to find this in the SHARE listing */
|
||||
if (current_share_info && search_dir_entry(current_share_info->entries, mypath, buf) == 0)
|
||||
if (current_share_info) {
|
||||
if (search_dir_entry (current_share_info->entries, mypath, buf) == 0)
|
||||
return 0;
|
||||
DEBUG(3, ("'%s' not found in share_info '%s'\n", path, current_share_info->dirname));
|
||||
DEBUG (3, ("'%s' not found in share_info '%s'\n", path,
|
||||
current_share_info->dirname));
|
||||
}
|
||||
/* try to find this in the SERVER listing */
|
||||
if (current_server_info && search_dir_entry(current_server_info->entries, mypath, buf) == 0)
|
||||
if (current_server_info) {
|
||||
if (search_dir_entry (current_server_info->entries, mypath, buf) == 0)
|
||||
return 0;
|
||||
DEBUG(3, ("'%s' not found in server_info '%s'\n", path, current_server_info->dirname));
|
||||
DEBUG (3, ("'%s' not found in server_info '%s'\n", path,
|
||||
current_server_info->dirname));
|
||||
}
|
||||
/* nothing found. get stat file info from server */
|
||||
return get_remote_stat (sc, path, buf);
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user