- Add memsep-random patch (bz 174767) Thu Jul 14 2005 Steve Grubb <sgrubb@redhat.com> 1.0.2-1 - New upstream version. Tue Jul 12 2005 Steve Grubb <sgrubb@redhat.com> 1.0.1-1 - New version fixes bug where audit system was disable at end of test. Wed Jun 8 2005 Steve Grubb <sgrubb@redhat.com> 1.0-2 - add a few more include "config.h" Fri May 27 2005 Steve Grubb <sgrubb@redhat.com> 1.0-1 - New upstream version from IBM - Drop memsep patch - Rework specfile Thu Sep 2 2004 root <ccb@redhat.com> 0.1-7RHEL - integrate memsep patch from Matt Anderson at HP Mon Aug 16 2004 root <ccb@redhat.com> 0.1-6RHEL - Integrate ia64 patches from HP's Matt Anderson, enabling use on ia64 Tue Jun 29 2004 root <ccb@redhat.com> 0.1-4RHEL - fix /usr/bin/amtu modes for real this time Tue Jun 29 2004 root <ccb@redhat.com> 0.1-4RHEL - set execute bits on /usr/bin/amtu Fri May 28 2004 ccb <ccb@redhat.com> 0.1-3RHEL - fixed owners and permissions in %files Wed May 26 2004 ccb <ccb@redhat.com> 0.1-2RHEL - move docs to a version-qualified directory name Sat May 1 2004 root <chavezt@cs679156-153.austin.rr.com> - Initial build.
32 lines
1 KiB
Diff
32 lines
1 KiB
Diff
--- amtu-1.0.2/src/memsep.c.orig 2005-12-01 23:11:44.000000000 -0500
|
|
+++ amtu-1.0.2/src/memsep.c 2005-12-01 22:58:17.000000000 -0500
|
|
@@ -56,6 +56,7 @@
|
|
#include "config.h"
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
+#include <stdint.h>
|
|
#include <unistd.h>
|
|
#include <string.h>
|
|
#include <signal.h>
|
|
@@ -91,15 +92,14 @@ void sig_handler(int sig)
|
|
/* range start <= j < end, aligned to sizeof(int) */
|
|
/* */
|
|
/************************************************************************/
|
|
+#if __LP64__
|
|
+#define RANDNUM ((uint64_t)random() << 32 | random())
|
|
+#else
|
|
+#define RANDNUM random()
|
|
+#endif
|
|
int *get_pointer_in_range(int *start, int *end)
|
|
{
|
|
- int *j;
|
|
- double n_ints;
|
|
-
|
|
- n_ints = (end - start)/sizeof(int);
|
|
-
|
|
- j = start + (int) (n_ints * rand()/(RAND_MAX + 1.0));
|
|
- return j;
|
|
+ return (int *)((char *)start + (RANDNUM % ((char *)end - (char *)start + 1)));
|
|
}
|
|
|
|
/************************************************************************/
|