Displaying 3 results from an estimated 3 matches for "old_length_of_ss".
2014 Nov 21
3
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...If realloc fails, the return value is null; this means that the
following will leak ss in that case.
Also, sounds like you are missing "," in the length of the string?
> + strcat(ss, ",");
Just save the length of ss before the realloc, and you can simply do
ss[old_length_of_ss] = ',';
> + strcat(ss, p);
You can easily use memcpy here:
memcpy (ss + old_length_of_ss + 1, p, strlen (p));
> + } else {
> + ss = strdup(p);
Missing check for failed strdup.
> + }
> +
> + p = pend;
> + }
&...
2014 Nov 24
0
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...ll; this means that the
> following will leak ss in that case.
>
> Also, sounds like you are missing "," in the length of the string?
>
> > + strcat(ss, ",");
>
> Just save the length of ss before the realloc, and you can simply do
> ss[old_length_of_ss] = ',';
>
> > + strcat(ss, p);
>
> You can easily use memcpy here:
> memcpy (ss + old_length_of_ss + 1, p, strlen (p));
>
> > + } else {
> > + ss = strdup(p);
>
> Missing check for failed strdup.
>
> > +...
2014 Nov 21
13
[PATCH 0/6] btrfs support part1: subvolume commands
Hi,
This is the part1 of improving btrfs support. This series adds missing
parameters to btrfs_subvolume_snapshot and btrfs_subvolume_create, and
adds two new API btrfs_subvolume_get_default and btrfs_subvolume_show.
Other parts will follow.
Regards,
Hu
Hu Tao (6):
btrfs: correct words about subvolume and snapshot
btrfs: add optional parameter `ro' to btrfs_subvolume_snapshot
btrfs: