]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/samba/samba-3.6.99-fix_keytab_null_termination.patch
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-suricata
[ipfire-2.x.git] / src / patches / samba / samba-3.6.99-fix_keytab_null_termination.patch
CommitLineData
1d13e637
AF
1From e56b5bf5eddfa89ae948dc7bb154dfc6154199a6 Mon Sep 17 00:00:00 2001
2From: Matt Rogers <mrogers@redhat.com>
3Date: Wed, 12 Nov 2014 17:21:05 +0100
4Subject: [PATCH] PATCHSET17: s3-keytab: fix keytab array NULL termination.
5
6Signed-off-by: Matt Rogers <mrogers@redhat.com>
7Reviewed-by: Guenther Deschner <gd@samba.org>
8Reviewed-by: Jeremy Allison <jra@samba.org>
9(cherry picked from commit 0de6799996955fbf8e19ace8c4b7b61f5a262cb5)
10Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
11---
12 source3/libads/kerberos_keytab.c | 3 +--
13 1 file changed, 1 insertion(+), 2 deletions(-)
14
15diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c
16index badce3e..1033842 100644
17--- a/source3/libads/kerberos_keytab.c
18+++ b/source3/libads/kerberos_keytab.c
19@@ -629,14 +629,13 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
20 goto done;
21 }
22
23- oldEntries = talloc_array(tmpctx, char *, found);
24+ oldEntries = talloc_zero_array(tmpctx, char *, found + 1);
25 if (!oldEntries) {
26 DEBUG(1, (__location__ ": Failed to allocate space to store "
27 "the old keytab entries (talloc failed?).\n"));
28 ret = -1;
29 goto done;
30 }
31- memset(oldEntries, '\0', found * sizeof(char *));
32
33 ret = krb5_kt_start_seq_get(context, keytab, &cursor);
34 if (ret == KRB5_KT_END || ret == ENOENT) {
35--
362.1.0
37