diff options
| -rw-r--r-- | lib/ss/invocation.c | 5 | ||||
| -rw-r--r-- | lib/ss/parse.c | 4 | ||||
| -rw-r--r-- | lib/ss/request_tbl.c | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/ss/invocation.c b/lib/ss/invocation.c index a7110500..08b66f28 100644 --- a/lib/ss/invocation.c +++ b/lib/ss/invocation.c @@ -20,6 +20,7 @@ #ifdef HAVE_DLOPEN #include <dlfcn.h> #endif +#include <errno.h> int ss_create_invocation(subsystem_name, version_string, info_ptr, request_table_ptr, code_ptr) @@ -46,6 +47,10 @@ int ss_create_invocation(subsystem_name, version_string, info_ptr, ; table = (ss_data **) realloc((char *)table, ((unsigned)sci_idx+2)*size); + if (table == NULL) { + *code_ptr = errno; + return 0; + } table[sci_idx+1] = (ss_data *) NULL; table[sci_idx] = new_table; diff --git a/lib/ss/parse.c b/lib/ss/parse.c index b70ad165..baded665 100644 --- a/lib/ss/parse.c +++ b/lib/ss/parse.c @@ -90,6 +90,10 @@ char **ss_parse (sci_idx, line_ptr, argc_ptr) parse_mode = TOKEN; cp = line_ptr; argv = NEW_ARGV (argv, argc); + if (argv == NULL) { + *argc_ptr = errno; + return argv; + } argv[argc++] = line_ptr; argv[argc] = NULL; } diff --git a/lib/ss/request_tbl.c b/lib/ss/request_tbl.c index b0b6f959..efdabfa3 100644 --- a/lib/ss/request_tbl.c +++ b/lib/ss/request_tbl.c @@ -35,7 +35,7 @@ void ss_add_request_table(sci_idx, rqtbl_ptr, position, code_ptr) ; /* size == C subscript of NULL == #elements */ size += 2; /* new element, and NULL */ - t = (ssrt **)realloc(info->rqt_tables, (unsigned)size*sizeof(ssrt)); + t = (ssrt **)realloc(info->rqt_tables, (unsigned)size*sizeof(ssrt *)); if (t == (ssrt **)NULL) { *code_ptr = errno; return; |
