]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
aft.c: Fix a nasty memory corruption bug in afs_ls on 64 bit archs.
authorAndre Noll <maan@systemlinux.org>
Wed, 19 Sep 2007 17:07:36 +0000 (19:07 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 19 Sep 2007 17:07:36 +0000 (19:07 +0200)
That was pretty hard to spot but obvious once found.

aft.c

diff --git a/aft.c b/aft.c
index 0013b2a2f52ce434a6826bd5a352a996ae28b875..423731f6b70e770f4b84924bbf9e3640b8e8ba51 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -827,7 +827,7 @@ static int ls_path_compare(const void *a, const void *b)
 static int sort_matching_paths(struct ls_options *options)
 {
        size_t nmemb = options->num_matching_paths;
 static int sort_matching_paths(struct ls_options *options)
 {
        size_t nmemb = options->num_matching_paths;
-       size_t size = sizeof(uint32_t);
+       size_t size = sizeof(*options->data_ptr);
        int (*compar)(const void *, const void *);
        int i;
 
        int (*compar)(const void *, const void *);
        int i;