diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-15 21:00:58 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-15 21:00:58 +0000 |
commit | b0bc4317224e4287a4a362097df173899fc1a5af (patch) | |
tree | 7b1ae63e84abef3b9dbf797124ec6112cfa2e93f /include | |
parent | aeb6b55d5e846a8864c38d94e61e9539a7527b31 (diff) |
Merged revisions 175829 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r175829 | russell | 2009-02-15 14:56:27 -0600 (Sun, 15 Feb 2009) | 14 lines
Fix a number of problems with ast_sched_report().
1) It had numerous coding guidelines violations with regards to formatting.
2) It allocated memory using ast_calloc() that was never freed.
3) It didn't check for failure from the allocation.
4) It used sprintf() and strcat() to build the result, doing zero checking to
prevent writing past the end of the provided buffer.
The function also lacks API documentation, but that has not been addressed in
this commit.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@175831 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/sched.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/asterisk/sched.h b/include/asterisk/sched.h index ab328af95..ae1592553 100644 --- a/include/asterisk/sched.h +++ b/include/asterisk/sched.h @@ -145,13 +145,12 @@ void sched_context_destroy(struct sched_context *c); typedef int (*ast_sched_cb)(const void *data); #define AST_SCHED_CB(a) ((ast_sched_cb)(a)) -struct ast_cb_names -{ +struct ast_cb_names { int numassocs; char *list[10]; ast_sched_cb cblist[10]; }; -char *ast_sched_report(struct sched_context *con, char *buf, int bufsiz, struct ast_cb_names *cbnames); +void ast_sched_report(struct sched_context *con, struct ast_str **buf, struct ast_cb_names *cbnames); /*! \brief Adds a scheduled event * Schedule an event to take place at some point in the future. callback |