Fixes a segfault when reading a /tasks file of a cgroup
containing a large number of pids.
Signed-off-by: Wolfgang Bumiller
---
lxcfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lxcfs.c b/lxcfs.c
index fe5ac3e..767a344 100644
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -85,7 +85,7 @
The initial check should use real lengths as with modulo a
new required length of eg. 52 would be considered smaller
than an old length of 48 (2 < 48).
To get the 'batches' count 'newlen' must be divided and not
taken modulo BATCH_SIZE. Otherwise '101', which would need a
3rd batch to reach 150, w
sprintf() already returns the length
Signed-off-by: Wolfgang Bumiller
---
lxcfs.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lxcfs.c b/lxcfs.c
index 767a344..8605000 100644
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -77,7 +77,7 @@ static void must_strcat_pid(char **src, size
If the first realloc() call fails then 'd' becomes NULL,
subsequent realloc() retries will behave like malloc() and
the the original src pointer is never freed. Further more
the newly allocated data then contains uninitialized data
where the previous pids had been stored.
Avoid this by passing the
Quoting Wolfgang Bumiller (w.bumil...@proxmox.com):
> The initial check should use real lengths as with modulo a
> new required length of eg. 52 would be considered smaller
> than an old length of 48 (2 < 48).
>
> To get the 'batches' count 'newlen' must be divided and not
> taken modulo BATCH_SIZ
Quoting Wolfgang Bumiller (w.bumil...@proxmox.com):
>
> > On January 7, 2016 at 7:42 PM Serge Hallyn wrote:
> >
> >
> > Quoting Wolfgang Bumiller (w.bumil...@proxmox.com):
> > > The initial check should use real lengths as with modulo a
> > > new required length of eg. 52 would be considered sm
Quoting Wolfgang Bumiller (w.bumil...@proxmox.com):
> If the first realloc() call fails then 'd' becomes NULL,
> subsequent realloc() retries will behave like malloc() and
> the the original src pointer is never freed. Further more
> the newly allocated data then contains uninitialized data
> where