Module Name: src Committed By: christos Date: Thu Nov 14 05:04:24 UTC 2013
Modified Files: src/crypto/external/bsd/heimdal/dist/lib/krb5: context.c Log Message: CID 240779: Wrong sizeof used in allocation To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c diff -u src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c:1.2 src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c:1.3 --- src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c:1.2 Thu Apr 14 14:02:07 2011 +++ src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c Thu Nov 14 00:04:24 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: context.c,v 1.2 2011/04/14 18:02:07 elric Exp $ */ +/* $NetBSD: context.c,v 1.3 2013/11/14 05:04:24 christos Exp $ */ /* * Copyright (c) 1997 - 2010 Kungliga Tekniska Högskolan @@ -433,13 +433,13 @@ copy_etypes (krb5_context context, ; i++; - *ret_enctypes = malloc(sizeof(ret_enctypes[0]) * i); + *ret_enctypes = malloc(sizeof(**ret_enctypes) * i); if (*ret_enctypes == NULL) { krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", "")); return ENOMEM; } - memcpy(*ret_enctypes, enctypes, sizeof(ret_enctypes[0]) * i); + memcpy(*ret_enctypes, enctypes, sizeof(**ret_enctypes) * i); return 0; }