[Fedora-directory-commits] adminutil/lib/libadminutil resource.c, 1.3, 1.4

Richard Allen Megginson rmeggins at fedoraproject.org
Thu Dec 4 15:57:38 UTC 2008


Author: rmeggins

Update of /cvs/dirsec/adminutil/lib/libadminutil
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5277/adminutil/lib/libadminutil

Modified Files:
	resource.c 
Log Message:
Resolves: bug 466137
Bug Description: htmladmin gives 500 error
Reviewed by: nkinder (Thanks!)
Fix Description: If the locale string passed in to res_getstring is bogus, the CGI will just exit (no crash, no security problems) which causes the 500 error.  ures_open returns U_ILLEGAL_ARGUMENT_ERROR if the locale string is bogus.  In this case, just use NULL for the locale which will cause it to use the default one.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no



Index: resource.c
===================================================================
RCS file: /cvs/dirsec/adminutil/lib/libadminutil/resource.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- resource.c	8 May 2007 19:13:25 -0000	1.3
+++ resource.c	4 Dec 2008 15:57:36 -0000	1.4
@@ -180,6 +180,12 @@
   }
 
   bundle = ures_open(resource->path, (const char*)locale, &status);
+  if (status == U_ILLEGAL_ARGUMENT_ERROR) {
+      /* the locale string is bogus - just use the default */
+      locale = NULL;
+      status = U_ZERO_ERROR;
+      bundle = ures_open(resource->path, (const char*)locale, &status);
+  }
 
   if(U_SUCCESS(status) && bundle) {
       int32_t umsglen=0;




More information about the Fedora-directory-commits mailing list