Prevent segfault on wrong data (gsoap doesn't guard it).
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 14 Aug 2007 16:26:09 +0000 (16:26 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 14 Aug 2007 16:26:09 +0000 (16:26 +0000)
org.glite.jp.index/Makefile
org.glite.jp.index/src/db_ops.c

index b8b0b06..ba5a0d2 100644 (file)
@@ -62,7 +62,7 @@ SRCS:= conf.c bones_server.c soap_ops.c soap_ps_calls.c common.c \
        ${is_prefix}Server.c ${ps_prefix}Client.c ${ws_prefix}C.c \
        ws_ps_typeref.c ws_is_typeref.c db_ops.c context.c common_server.c 
 
-EXA_TEST_SRCS:=jpis-test.c ${is_prefix}Client.c ${is_prefix}C.c context.c db_ops.c conf.c ws_is_typeref.c
+EXA_TEST_SRCS:=jpis-test.c ${is_prefix}Client.c ${is_prefix}C.c context.c common.c db_ops.c conf.c ws_is_typeref.c
 EXA_DB_SRCS:=jpis-db-internal.c db_ops.c conf.c context.c ws_is_typeref.c
 EXA_CLIENT_SRCS:=jpis-client.c ${is_prefix}Client.c ${is_prefix}C.c common.c
 
index 807fe45..b6353eb 100644 (file)
@@ -18,6 +18,7 @@
 #include "conf.h"
 #include "context.h"
 #include "db_ops.h"
+#include "common.h"
 
 
 #ifndef LOG_SQL
@@ -647,6 +648,10 @@ int glite_jpis_lazyInsertJob(glite_jpis_context_t ctx, const char *ps, const cha
 
        lprintf("\n");
 
+       if (!jobid || !owner) {
+               glite_jpis_stack_error(ctx->jpctx, EINVAL, "jobid and owner is mandatory (jobid=%s, owner=%s)!\n", jobid, owner);
+               goto fail;
+       }
        md5_jobid = str2md5(jobid);
        md5_cert = str2md5(owner);
        GLITE_JPIS_PARAM(ctx->param_jobid, ctx->param_jobid_len, md5_jobid);