diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 13:45:03 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 13:45:03 +0000 |
commit | 3c76d5d2f641422262538f20e956d2f9e21c3139 (patch) | |
tree | 6581d7a3436a0fb06ef57889f6c04e34a7f30bf5 /include | |
parent | 30d145fa3a8f32f40c03732ada8ca948d5614ef6 (diff) |
In this debugging function, copy to a buffer instead of using potentially unsafe pointers.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@125793 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/lock.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h index eae56f4cd..5b9664c55 100644 --- a/include/asterisk/lock.h +++ b/include/asterisk/lock.h @@ -186,9 +186,9 @@ void ast_remove_lock_info(void *lock_addr); * be preserved as to what location originally acquired the lock. */ #if !defined(LOW_MEMORY) -int ast_find_lock_info(void *lock_addr, const char **filename, int *lineno, const char **func, const char **mutex_name); +int ast_find_lock_info(void *lock_addr, char *filename, size_t filename_size, int *lineno, char *func, size_t func_size, char *mutex_name, size_t mutex_name_size); #else -#define ast_find_lock_info(a,b,c,d,e) -1 +#define ast_find_lock_info(a,b,c,d,e,f,g,h) -1 #endif /*! @@ -199,9 +199,9 @@ int ast_find_lock_info(void *lock_addr, const char **filename, int *lineno, cons */ #define DEADLOCK_AVOIDANCE(lock) \ do { \ - const char *__filename, *__func, *__mutex_name; \ + char __filename[80], __func[80], __mutex_name[80]; \ int __lineno; \ - int __res = ast_find_lock_info(lock, &__filename, &__lineno, &__func, &__mutex_name); \ + int __res = ast_find_lock_info(lock, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \ ast_mutex_unlock(lock); \ usleep(1); \ if (__res < 0) { /* Shouldn't ever happen, but just in case... */ \ |