Module Name: src
Committed By: abhinav
Date: Tue Oct 31 10:14:27 UTC 2017
Modified Files:
src/usr.sbin/makemandb: custom_apropos_tokenizer.c
Log Message:
Casting variable of type int * to size_t *, may cause
alignment issues on some platforms (e.g. Sparc64)
So, Use a temporary variable to avoid the cast.
Thanks to Martin@ for noticing the issue and also suggesting the issue.
Fixes PR bin/52678
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/makemandb/custom_apropos_tokenizer.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/makemandb/custom_apropos_tokenizer.c
diff -u src/usr.sbin/makemandb/custom_apropos_tokenizer.c:1.1 src/usr.sbin/makemandb/custom_apropos_tokenizer.c:1.2
--- src/usr.sbin/makemandb/custom_apropos_tokenizer.c:1.1 Sun Jun 18 16:24:10 2017
+++ src/usr.sbin/makemandb/custom_apropos_tokenizer.c Tue Oct 31 10:14:27 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: custom_apropos_tokenizer.c,v 1.1 2017/06/18 16:24:10 abhinav Exp $ */
+/* $NetBSD: custom_apropos_tokenizer.c,v 1.2 2017/10/31 10:14:27 abhinav Exp $ */
/*
** 2006 September 30
**
@@ -716,7 +716,10 @@ aproposPorterNext(
return SQLITE_NOMEM;
c->zToken = pNew;
}
- int stemStatus = do_stem(&z[iStartOffset], n, c->zToken, (size_t *) pnBytes);
+
+ size_t temp;
+ int stemStatus = do_stem(&z[iStartOffset], n, c->zToken, &temp);
+ *pnBytes = temp;
if (stemStatus != SQLITE_OK)
return stemStatus;