Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/heimdal/dist/lib/krb5 CID 240779: Wrong ...



details:   https://anonhg.NetBSD.org/src/rev/9b47efed7aca
branches:  trunk
changeset: 791359:9b47efed7aca
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Nov 14 05:04:24 2013 +0000

description:
CID 240779: Wrong sizeof used in allocation

diffstat:

 crypto/external/bsd/heimdal/dist/lib/krb5/context.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r c2db7cc84a40 -r 9b47efed7aca crypto/external/bsd/heimdal/dist/lib/krb5/context.c
--- a/crypto/external/bsd/heimdal/dist/lib/krb5/context.c       Thu Nov 14 04:27:50 2013 +0000
+++ b/crypto/external/bsd/heimdal/dist/lib/krb5/context.c       Thu Nov 14 05:04:24 2013 +0000
@@ -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 @@
        ;
     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;
 }
 



Home | Main Index | Thread Index | Old Index