mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +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 *vsa = (const struct vfs_stamping *) a;
|
||||||
const struct vfs_stamping *vsb = (const struct vfs_stamping *) b;
|
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;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
stamp = g_slist_find_custom (stamps, &what, vfs_stamp_compare);
|
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);
|
gettimeofday (&(VFS_STAMPING (stamp->data)->time), NULL);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user