From c9f313ba6a26a0a21632b439e690efefc4e7c260 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 22 Jul 2009 22:40:13 +0100 Subject: [PATCH] Do not call principal_ntoh to copy ktc_principal structs principal_ntoh() is designed for butc_principal structures, which are a different size from ktc_principal structures, and so it can't be used to copy them. Reviewed-on: http://gerrit.openafs.org/http://gerrit.openafs.org/185 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- src/budb/struct_ops.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/budb/struct_ops.c b/src/budb/struct_ops.c index 63ef1ffbe..9a5c4ffab 100644 --- a/src/budb/struct_ops.c +++ b/src/budb/struct_ops.c @@ -363,9 +363,12 @@ dump_ntoh(struct dump *netDumpPtr, { hostDumpPtr->id = ntohl(netDumpPtr->id); hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain); - strcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName); - strcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath); - strcpy(hostDumpPtr->volumeSet, netDumpPtr->volumeSet); + strlcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName, + sizeof(hostDumpPtr->dumpName)); + strlcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath, + sizeof(hostDumpPtr->dumpPath)); + strlcpy(hostDumpPtr->volumeSet, netDumpPtr->volumeSet, + sizeof(hostDumpPtr->volumeSet)); hostDumpPtr->nameHashChain = ntohl(netDumpPtr->nameHashChain); hostDumpPtr->flags = ntohl(netDumpPtr->flags); hostDumpPtr->parent = ntohl(netDumpPtr->parent); @@ -377,7 +380,7 @@ dump_ntoh(struct dump *netDumpPtr, hostDumpPtr->firstTape = ntohl(netDumpPtr->firstTape); - principal_ntoh(&netDumpPtr->dumper, &hostDumpPtr->dumper); + hostDumpPtr->dumper = netDumpPtr->dumper; } void -- 2.39.5