From: Peter Howkins Date: Fri, 13 Jul 2018 17:22:53 +0000 (+0100) Subject: dtcm: Also make sure to reset non pointer fields, so that on future failures they... X-Git-Tag: 2.3.0a~97 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=de3993130a55918ed41f1650708e65c6debb48eb;p=oweals%2Fcde.git dtcm: Also make sure to reset non pointer fields, so that on future failures they don't return stale data (due to static) --- diff --git a/cde/programs/dtcm/server/rtable2.c b/cde/programs/dtcm/server/rtable2.c index ac34290a..eb3e02b6 100644 --- a/cde/programs/dtcm/server/rtable2.c +++ b/cde/programs/dtcm/server/rtable2.c @@ -301,7 +301,9 @@ _DtCm_rtable_check_2_svc(Table_Args_2 *args, struct svc_req *svcrq) static Table_Status_2 res; Table_Args_4 *newargs; Table_Status_4 *newres; - + + res = 0; + newargs = _DtCm_tableargs2_to_tableargs4(args); if(newargs) { newres = _DtCm_rtable_check_4_svc(newargs, svcrq); @@ -321,7 +323,9 @@ _DtCm_rtable_flush_table_2_svc(Table_Args_2 *args, struct svc_req *svcrq) static Table_Status_2 res; Table_Args_4 *newargs; Table_Status_4 *newres; - + + res = 0; + newargs = _DtCm_tableargs2_to_tableargs4(args); newres = _DtCm_rtable_flush_table_4_svc(newargs, svcrq); @@ -338,7 +342,9 @@ _DtCm_rtable_size_2_svc(Table_Args_2 *args, struct svc_req *svcrq) { static int size; Table_Args_4 *newargs; - + + size = 0; + newargs = _DtCm_tableargs2_to_tableargs4(args); if(newargs) { size = (*(_DtCm_rtable_size_4_svc(newargs, svcrq))); @@ -357,6 +363,8 @@ _DtCm_register_callback_2_svc(Registration_2 *r, struct svc_req *svcrq) Registration_4 *newreg; Registration_Status_4 *newstat; + stat = 0; + newreg = _DtCm_reg2_to_reg4(r); if(newreg) { newstat = _DtCm_register_callback_4_svc(newreg, svcrq); @@ -374,7 +382,9 @@ _DtCm_deregister_callback_2_svc(Registration_2 *r, struct svc_req *svcrq) static Registration_Status_2 stat; Registration_4 *newreg; Registration_Status_4 *newstat; - + + stat = 0; + newreg = _DtCm_reg2_to_reg4(r); if(newreg) { newstat = _DtCm_deregister_callback_4_svc(newreg, svcrq); @@ -393,7 +403,9 @@ _DtCm_rtable_set_access_2_svc(Access_Args_2 *args, struct svc_req *svcrq) static Access_Status_2 stat; Access_Args_4 *newargs; Access_Status_4 *newstat; - + + stat = 0; + newargs = _DtCm_accargs2_to_accargs4(args); if(newargs) { newstat = _DtCm_rtable_set_access_4_svc(newargs, svcrq); diff --git a/cde/programs/dtcm/server/rtable3.c b/cde/programs/dtcm/server/rtable3.c index 41b96ec9..44fe3799 100644 --- a/cde/programs/dtcm/server/rtable3.c +++ b/cde/programs/dtcm/server/rtable3.c @@ -274,6 +274,8 @@ _DtCm_rtable_check_3_svc(Table_Args_3 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Status_4 *newres; + res = 0; + newargs = _DtCm_tableargs3_to_tableargs4(args); newres = _DtCm_rtable_check_4_svc(newargs, svcrq); res = _DtCm_tablestat4_to_tablestat3(*newres); @@ -291,6 +293,8 @@ _DtCm_rtable_flush_table_3_svc(Table_Args_3 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Status_4 *newres; + res = 0; + newargs = _DtCm_tableargs3_to_tableargs4(args); newres = _DtCm_rtable_flush_table_4_svc(newargs, svcrq); res = _DtCm_tablestat4_to_tablestat3(*newres); @@ -307,6 +311,8 @@ _DtCm_rtable_size_3_svc(Table_Args_3 *args, struct svc_req *svcrq) static int size; Table_Args_4 *newargs; + size = 0; + newargs = _DtCm_tableargs3_to_tableargs4(args); size = (*(_DtCm_rtable_size_4_svc(newargs, svcrq))); @@ -323,6 +329,8 @@ _DtCm_register_callback_3_svc(Registration_3 *r, struct svc_req *svcrq) Registration_4 *newreg; Registration_Status_4 *newstat; + stat = 0; + newreg = _DtCm_reg3_to_reg4(r); newstat = _DtCm_register_callback_4_svc(newreg, svcrq); stat = _DtCm_regstat4_to_regstat3(*newstat); @@ -339,6 +347,8 @@ _DtCm_deregister_callback_3_svc(Registration_3 *r, struct svc_req *svcrq) Registration_4 *newreg; Registration_Status_4 *newstat; + stat = 0; + newreg = _DtCm_reg3_to_reg4(r); newstat = _DtCm_deregister_callback_4_svc(newreg, svcrq); stat = _DtCm_regstat4_to_regstat3(*newstat); @@ -355,6 +365,8 @@ _DtCm_rtable_set_access_3_svc(Access_Args_3 *args, struct svc_req *svcrq) Access_Args_4 *newargs; Access_Status_4 *newstat; + stat = 0; + newargs = _DtCm_accargs3_to_accargs4(args); newstat = _DtCm_rtable_set_access_4_svc(newargs, svcrq); stat = _DtCm_accstat4_to_accstat3(*newstat);