]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix some stuff involving calls to memcpy and memset
authorJonathan Rose <jrose@digium.com>
Wed, 4 Apr 2012 19:52:05 +0000 (19:52 +0000)
committerJonathan Rose <jrose@digium.com>
Wed, 4 Apr 2012 19:52:05 +0000 (19:52 +0000)
The important parts of the patch were already applied through other updates.

(closes issue ASTERISK-19445)
Reported by: Makoto Dei
Patches:
memset-memcpy-length.patch uploaded by Makoto Dei (license 5027)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361210 65c4cc65-6c06-0410-ace0-fbb531ad65f3

addons/ooh323cDriver.c

index f8621aa877ab12f526aee941619c720edc5f1893..d9648983504ab21f81f2269f914c151461c3f272 100644 (file)
@@ -145,14 +145,13 @@ int ooh323c_start_call_thread(ooCallData *call) {
 
 /* make new thread */
  if (cur == NULL) {
-       if (!(cur = ast_malloc(sizeof(struct callthread)))) {
+       if (!(cur = ast_calloc(1, sizeof(struct callthread)))) {
                ast_log(LOG_ERROR, "Unable to allocate thread structure for call %s\n",
                                                        call->callToken);
                return -1;
        }
 
        ast_module_ref(myself);
-       memset(cur, 0, sizeof(cur));
        if ((socketpair(PF_LOCAL, SOCK_STREAM, 0, cur->thePipe)) == -1) {
                ast_log(LOG_ERROR, "Can't create thread pipe for call %s\n", call->callToken);
                free(cur);