search for: guestfs_int_dirent_list_v

Displaying 3 results from an estimated 3 matches for "guestfs_int_dirent_list_v".

2015 Jan 20
9
[PATCH] daemon: readdir: fix invalid memory access on error
If "strdup (d->d_name)" fails with "i" > 0, then both "p" and "ret->guestfs_int_dirent_list_val" are non-null pointers, but the latter is no more valid (since "p" is the new realloc'ed buffer). Hence, trying to free both will access to invalid memory. Make sure to free only one of them, "p" if not null or "ret->guestfs_int_dirent_list_val" otherwis...
2015 Jan 21
0
Re: [PATCH] daemon: readdir: fix invalid memory access on error
On Tue, Jan 20, 2015 at 04:28:39PM +0100, Pino Toscano wrote: > If "strdup (d->d_name)" fails with "i" > 0, then both "p" and > "ret->guestfs_int_dirent_list_val" are non-null pointers, but the latter > is no more valid (since "p" is the new realloc'ed buffer). Hence, trying > to free both will access to invalid memory. > > Make sure to free only one of them, "p" if not null or > "ret->guestfs_int_diren...
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
..._CANCEL_FLAG); + flag, GUESTFS_CANCEL_FLAG); return 0; } diff --git a/daemon/readdir.c b/daemon/readdir.c index e3851db..17fc619 100644 --- a/daemon/readdir.c +++ b/daemon/readdir.c @@ -63,7 +63,7 @@ do_readdir (char *path) guestfs_int_dirent *p; p = realloc (ret->guestfs_int_dirent_list_val, - sizeof (guestfs_int_dirent) * (i+1)); + sizeof (guestfs_int_dirent) * (i+1)); v.name = strdup (d->d_name); if (!p || !v.name) { reply_with_perror ("allocate"); diff --git a/daemon/sfdisk.c b/daemon/sfdisk.c index f512e26..e06d0bf 100644 --- a/dae...