Skip to content

Commit

Permalink
Fix potential read access to local stack memory after returning from …
Browse files Browse the repository at this point in the history
…a function

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17559 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 6, 2013
1 parent 7b27796 commit f5f3408
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SimulationRuntime/c/meta/meta_modelica.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ extern void mmc_init();
#define MMC_THROW() {longjmp(*((threadData_t*)pthread_getspecific(mmc_thread_data_key))->mmc_jumper,1);}
#define MMC_ELSE() } else {

#define MMC_TRY_TOP() { threadData_t threadDataOnStack = {0}, *threadData = &threadDataOnStack; pthread_setspecific(mmc_thread_data_key,threadData); MMC_TRY_INTERNAL(mmc_jumper)
#define MMC_CATCH_TOP(X) threadData->mmc_jumper = old_jumper; } else {threadData->mmc_jumper = old_jumper;X;}}}
#define MMC_TRY_TOP() { threadData_t threadDataOnStack = {0}, *oldThreadData = pthread_getspecific(mmc_thread_data_key), *threadData = &threadDataOnStack; pthread_setspecific(mmc_thread_data_key,threadData); MMC_TRY_INTERNAL(mmc_jumper)
#define MMC_CATCH_TOP(X) pthread_setspecific(mmc_thread_data_key,oldThreadData); } else {pthread_setspecific(mmc_thread_data_key,oldThreadData);X;}}}

#if defined(__cplusplus)
}
Expand Down

0 comments on commit f5f3408

Please sign in to comment.