From 7592a925b57e356468b793b9e5f42832a19826e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 11 Dec 2008 04:56:54 +0000 Subject: [PATCH] avoid strndup since it doesnt do what we expect on aix git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24086 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hdb/hdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/hdb/hdb.c b/lib/hdb/hdb.c index 8cf43f6e0..6dc99aebf 100644 --- a/lib/hdb/hdb.c +++ b/lib/hdb/hdb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2007 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -263,9 +263,10 @@ find_dynamic_method (krb5_context context, len = p - filename; *rest = filename + len + 1; - prefix = strndup(filename, len); + prefix = malloc(len + 1); if (prefix == NULL) krb5_errx(context, 1, "out of memory"); + strlcpy(prefix, filename, len + 1); if (asprintf(&path, LIBDIR "/hdb_%s.so", prefix) == -1) krb5_errx(context, 1, "out of memory");