Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5552
Modified Files:
Tag: Release_0_9_5_stable
risxhandler.c
Log Message:
fixed custabbrev vs. user typo;check for invalid title type attribute
Index: risxhandler.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -U2 -r1.28 -r1.28.2.1
--- risxhandler.c 16 Feb 2004 21:38:06 -0000 1.28
+++ risxhandler.c 7 May 2004 21:27:51 -0000 1.28.2.1
@@ -742,5 +742,5 @@
}
}
- else if (title_type && !strcmp(title_type, "custabbrev1")) {
+ else if (title_type && !strcmp(title_type, "user1")) {
if (((ptr_ardata->perinfo).custabbrev1 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev1)) == -1) {
if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) {
@@ -755,5 +755,5 @@
}
}
- else if (title_type && !strcmp(title_type, "custabbrev2")) {
+ else if (title_type && !strcmp(title_type, "user2")) {
if (((ptr_ardata->perinfo).custabbrev2 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev2)) == -1) {
if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) {
@@ -768,5 +768,5 @@
}
}
- else {
+ else if (!title_type || !*title_type || !strcmp(title_type, "gen")){
if (!strcmp(ptr_ardata->type, "CHAP")
|| !strcmp(ptr_ardata->type, "CASE")
@@ -778,4 +778,11 @@
}
}
+ else {
+ /* this means we've received invalid risx data */
+ if ((new_msgpool = mstrcat(ptr_ardata->msgpool, "invalid title attribute", &(ptr_ardata->msgpool_len), 0)) == NULL) {
+ (ptr_ardata->ndb_error)++;
+ return;
+ }
+ }
}
else { /* set */
|