summaryrefslogtreecommitdiffstats
path: root/lib/libsi18n
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2006-04-11 02:14:54 +0000
committerRich Megginson <rmeggins@redhat.com>2006-04-11 02:14:54 +0000
commite8c67e58c2faa3e3f5d328a92391a5a6a4569620 (patch)
tree7e16092b4dfb0106f446bb6a79552004399f7155 /lib/libsi18n
parent9545e36805201ac0e3172b762373c6df741c2721 (diff)
downloadds-e8c67e58c2faa3e3f5d328a92391a5a6a4569620.tar.gz
ds-e8c67e58c2faa3e3f5d328a92391a5a6a4569620.tar.xz
ds-e8c67e58c2faa3e3f5d328a92391a5a6a4569620.zip
Bug(s) fixed: 186280
Bug Description: ldapserver: Close potential security vulnerabilities in CGI code Reviewed by: Nathan, Noriko, and Pete (Thanks!) Fix Description: Clean up usage of sprintf, strcpy, fgets instead of gets, fixed buffer usage, etc., mostly in the CGI code and other user facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick to force it to check printf style varargs functions, to check the format string against the argument string, for type mismatches, missing arguments, and too many arguments. In the CGI form argument parsing code, we needed to be more careful about checking for bad input - good input is supposed to look like this: name=value&name=value&..... &name=value. I don't think the original code was checking properly for something like name&name=value. There was another place where we were not checking to see if a buffer had enough room before appending a string to it. I had to change a couple of functions to allow passing in the size of the buffer. Fixed some issues raised by Noriko and Nathan. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
Diffstat (limited to 'lib/libsi18n')
-rw-r--r--lib/libsi18n/acclanglist.c1
-rw-r--r--lib/libsi18n/makstrdb.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libsi18n/acclanglist.c b/lib/libsi18n/acclanglist.c
index 1fd4f15f..e66d6595 100644
--- a/lib/libsi18n/acclanglist.c
+++ b/lib/libsi18n/acclanglist.c
@@ -200,6 +200,7 @@ XP_AccLangList(char* AcceptLanguage,
/* Add current language for future appending.,make sure it's not on list */
if ((strlen(curLanguageList[i]) > 2) && (curLanguageList[i][2] == '_')) {
strncpy(lang, curLanguageList[i], 2);
+ lang[sizeof(lang)-1] = 0;
for (k = 0; (k < index) && strcmp(AcceptLanguageList[k], lang); k++);
if (k != index) lang[0] = '\0';
diff --git a/lib/libsi18n/makstrdb.c b/lib/libsi18n/makstrdb.c
index 4669a79c..ca69f9b1 100644
--- a/lib/libsi18n/makstrdb.c
+++ b/lib/libsi18n/makstrdb.c
@@ -119,7 +119,6 @@ XP_MakeStringDatabase(void)
char* cptr;
RESOURCE_TABLE* table;
NSRESHANDLE hresdb;
- char DBTlibraryName[128];
/* Creating database */
hresdb = NSResCreateTable(DATABASE_NAME, NULL);
@@ -189,7 +188,7 @@ XP_MakeStringProperties(void)
*/
src = table->str;
dest = buffer;
- while (*src) {
+ while (*src && (sizeof(buffer) > (dest-buffer))) {
if (*src < 0x20) {
strcpy(dest,"\\u00");
dest += 4;