You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by da...@apache.org on 2007/06/30 01:25:43 UTC

svn commit: r552060 - /apr/apr/trunk/test/testuser.c

Author: davi
Date: Fri Jun 29 16:25:41 2007
New Revision: 552060

URL: http://svn.apache.org/viewvc?view=rev&rev=552060
Log:
apr_gid_name and apr_uid_name return null on Win98 which causes the test to fail
an ABTS_PTR_NOTNULL assertion, however the test will continue after failing that
assertion which will cause a NULL pointer dereference in subsequent apr_gid_get or
apr_uid_get call.

Submitted by: Curt Arnold
PR: 42318


Modified:
    apr/apr/trunk/test/testuser.c

Modified: apr/apr/trunk/test/testuser.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testuser.c?view=diff&rev=552060&r1=552059&r2=552060
==============================================================================
--- apr/apr/trunk/test/testuser.c (original)
+++ apr/apr/trunk/test/testuser.c Fri Jun 29 16:25:41 2007
@@ -44,6 +44,9 @@
                        apr_uid_name_get(&uname, uid, p));
     ABTS_PTR_NOTNULL(tc, uname);
 
+    if (uname == NULL)
+        return;
+
     APR_ASSERT_SUCCESS(tc, "apr_uid_get failed",
                        apr_uid_get(&retreived_uid, &retreived_gid, uname, p));
 
@@ -86,6 +89,9 @@
     APR_ASSERT_SUCCESS(tc, "apr_gid_name_get failed",
                        apr_gid_name_get(&gname, gid, p));
     ABTS_PTR_NOTNULL(tc, gname);
+
+    if (gname == NULL)
+        return;
 
     APR_ASSERT_SUCCESS(tc, "apr_gid_get failed",
                        apr_gid_get(&retreived_gid, gname, p));