summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2008-12-25 22:37:24 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2008-12-25 22:37:24 +0100
commitbfcb62aea8c30e43ac191ffd1eb40a86ca1ec846 (patch)
tree3ad93e73653908c9230a1c7a730aee28417ff75c
parent79b0dea35d73a52aba5567b15c95665b08e4e26f (diff)
downloadeurephia-bfcb62aea8c30e43ac191ffd1eb40a86ca1ec846.tar.gz
eurephia-bfcb62aea8c30e43ac191ffd1eb40a86ca1ec846.tar.xz
eurephia-bfcb62aea8c30e43ac191ffd1eb40a86ca1ec846.zip
Added check if fieldMapping node's table attribute is set
-rw-r--r--database/eurephiadb_mapping.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/database/eurephiadb_mapping.c b/database/eurephiadb_mapping.c
index 406fece..e1b7432 100644
--- a/database/eurephiadb_mapping.c
+++ b/database/eurephiadb_mapping.c
@@ -151,7 +151,12 @@ eDBfieldMap *eDBxmlMapping(eurephiaCTX *ctx, eDBfieldMap *dbmap, const char *tbl
}
// Make sure the fmapnode is suitable for the given dbmap
+ assert( TABLE_NAME[dbmap->tableid] != NULL );
fmap_table = xmlGetAttrValue(fmapnode->properties, "table");
+ if( fmap_table == NULL ) {
+ eurephia_log(ctx, LOG_ERROR, 0, "Invalid fieldMapping XML document");
+ return NULL;
+ }
if( strcmp(fmap_table, TABLE_NAME[dbmap->tableid]) != 0 ) {
eurephia_log(ctx, LOG_ERROR, 0, "Mismatch between XML fieldMapping and eDBfieldMap");
return NULL;