In bm_utils.c we have, in the tbl_open() function, the code:
if (*tdefs[tbl].name == PATH_SEP)
strcpy(fullpath, tdefs[tbl].name);
but how can a table name begin with a path separator? Shouldn't we disable this? e.g. apply something like the following: ?
diff --git a/src/bm_utils.c b/src/bm_utils.c
index a7e08c8..4cd57ca 100644
--- a/src/bm_utils.c
+++ b/src/bm_utils.c
@@ -367,9 +367,12 @@ tbl_open(int tbl, char *mode)
int retcode;
- if (*tdefs[tbl].name == PATH_SEP)
+/* This is not possible - no table names begin with a path separator
+
+ if (*tdefs[tbl].name == PATH_SEP)
strcpy(fullpath, tdefs[tbl].name);
else
+ */
sprintf(fullpath, "%s%c%s",
env_config(PATH_TAG, PATH_DFLT), PATH_SEP, tdefs[tbl].name);
In
bm_utils.cwe have, in thetbl_open()function, the code:but how can a table name begin with a path separator? Shouldn't we disable this? e.g. apply something like the following: ?