PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Thu Dec 6 16:55:25 PST 2007


 src/polkit/polkit-authorization-db.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5ea38976e02f7b5992e23f3c02c2f131d6fa296b
Author: David Zeuthen <davidz at redhat.com>
Date:   Thu Dec 6 19:52:07 2007 -0500

    use strlen to avoid writing garbage at the end of the test auth file
    
    While this seems like a grave bug it is not. First, this only affects
    the test cases and the file is guaranteed to be zero terminated before
    the garbage anyway.

diff --git a/src/polkit/polkit-authorization-db.c b/src/polkit/polkit-authorization-db.c
index 259e841..9c58dea 100644
--- a/src/polkit/polkit-authorization-db.c
+++ b/src/polkit/polkit-authorization-db.c
@@ -1227,7 +1227,7 @@ _run_test (void)
                                     test_pu2_lib, sizeof (test_pu2_lib) - 1))
                 goto out;
         if (!kit_file_set_contents (TEST_DATA_DIR "authdb-test/run/PolicyKit/user-pu3.auths", 0644, 
-                                    test_pu3_run, sizeof (test_pu3_run) - 1))
+                                    test_pu3_run, strlen (test_pu3_run)))
                 goto out;
         if (!kit_file_set_contents (TEST_DATA_DIR "authdb-test/lib/PolicyKit/user-pu3.auths", 0644, 
                                     test_pu3_lib, sizeof (test_pu3_lib) - 1))


More information about the hal-commit mailing list