mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
(vfs_stamp_compare): fix NULL dereference.
(vfs_stamp): likewise. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
12a6af8f29
commit
8411b93ff7
@ -127,7 +127,7 @@ vfs_stamp_compare (gconstpointer a, gconstpointer b)
|
||||
const struct vfs_stamping *vsa = (const struct vfs_stamping *) a;
|
||||
const struct vfs_stamping *vsb = (const struct vfs_stamping *) b;
|
||||
|
||||
return (vsa->v == vsb->v && vsa->id == vsb->id) ? 0 : 1;
|
||||
return (vsa == NULL || vsb == NULL || (vsa->v == vsb->v && vsa->id == vsb->id)) ? 0 : 1;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -163,7 +163,7 @@ vfs_stamp (struct vfs_class *v, vfsid id)
|
||||
gboolean ret = FALSE;
|
||||
|
||||
stamp = g_slist_find_custom (stamps, &what, vfs_stamp_compare);
|
||||
if (stamp != NULL)
|
||||
if (stamp != NULL && stamp->data != NULL)
|
||||
{
|
||||
gettimeofday (&(VFS_STAMPING (stamp->data)->time), NULL);
|
||||
ret = TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user