From 4c3aea3f62a76fa62ead66d64941156375fc4501 Mon Sep 17 00:00:00 2001 From: SATOH Fumiyasu Date: Wed, 17 Dec 2008 00:54:30 +0900 Subject: commit b520befe6f51644d20434add9864d7a2fa30aa2e Author: SATOH Fumiyasu Date: Wed Dec 17 00:42:25 2008 +0900 libsmbclient: Fix SIGBUS on non-x86 CPUs We must align the struct smbc_dirent in the struct SMBC_internal_data because the struct smbc_dirent has numeric values that require alignment. Signed-off-by: Derrell Lipman --- source3/libsmb/libsmb_dir.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index d12e7487f6..770014b6f6 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -976,9 +976,8 @@ SMBC_readdir_ctx(SMBCCTX *context, } - dirp = (struct smbc_dirent *)context->internal->dirent; - maxlen = (sizeof(context->internal->dirent) - - sizeof(struct smbc_dirent)); + dirp = &context->internal->dirent; + maxlen = sizeof(context->internal->_dirent_name); smbc_readdir_internal(context, dirp, dirent, maxlen); @@ -1049,9 +1048,8 @@ SMBC_getdents_ctx(SMBCCTX *context, } /* Do urlencoding of next entry, if so selected */ - dirent = (struct smbc_dirent *)context->internal->dirent; - maxlen = (sizeof(context->internal->dirent) - - sizeof(struct smbc_dirent)); + dirent = &context->internal->dirent; + maxlen = sizeof(context->internal->_dirent_name); smbc_readdir_internal(context, dirent, dirlist->dirent, maxlen); -- cgit