From e69714739f64475d71633fd4cb3523bc1ae143bb Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 19 Sep 2011 11:05:59 -0400 Subject: [PATCH] ntohs ubik header size The 'size' field in the ubik header is only 16-bits wide, so we should be using ntohs to read it, not ntohl. The database checking utilities for the prdb and kadb were still using ntohl (vldb was fixed by 591f9b6de9ab3dc5c17ad41af0241527f7f04b31). Change-Id: Ic3894f5ae78ff05279e87b364841c5f6dfdf803c Reviewed-on: http://gerrit.openafs.org/5466 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- src/kauth/rebuild.c | 2 +- src/ptserver/db_verify.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kauth/rebuild.c b/src/kauth/rebuild.c index 2722b35719..6794d9d42a 100644 --- a/src/kauth/rebuild.c +++ b/src/kauth/rebuild.c @@ -55,7 +55,7 @@ readUbikHeader(void) } uheader.magic = ntohl(uheader.magic); - uheader.size = ntohl(uheader.size); + uheader.size = ntohs(uheader.size); uheader.version.epoch = ntohl(uheader.version.epoch); uheader.version.counter = ntohl(uheader.version.counter); diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index 1a51a40259..2a95e349c3 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -210,7 +210,7 @@ readUbikHeader(struct misc_data *misc) } uheader.magic = ntohl(uheader.magic); - uheader.size = ntohl(uheader.size); + uheader.size = ntohs(uheader.size); uheader.version.epoch = ntohl(uheader.version.epoch); uheader.version.counter = ntohl(uheader.version.counter);