FreeBSD Bugzilla – Attachment 155642 Details for
Bug 199480
lang/lua52, lang/lua53: Use 'arc4random()' instead of 'time()' for string hash seed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
lua-makeseed.diff
lua-makeseed.diff (text/plain), 1.45 KB, created by
Vitaly Magerya
on 2015-04-16 12:11:13 UTC
(
hide
)
Description:
lua-makeseed.diff
Filename:
MIME Type:
Creator:
Vitaly Magerya
Created:
2015-04-16 12:11:13 UTC
Size:
1.45 KB
patch
obsolete
>diff -ruN lua52.orig/files/patch-src__lstate.c lua52/files/patch-src__lstate.c >--- lua52.orig/files/patch-src__lstate.c 1970-01-01 03:00:00.000000000 +0300 >+++ lua52/files/patch-src__lstate.c 2015-04-16 14:23:15.000000000 +0300 >@@ -0,0 +1,15 @@ >+--- src/lstate.c.orig 2014-11-02 21:33:33.000000000 +0200 >++++ src/lstate.c 2015-04-16 14:22:07.000000000 +0300 >+@@ -43,8 +43,12 @@ >+ /* >+ ** a macro to help the creation of a unique random seed when a state is >+ ** created; the seed is used to randomize hashes. >+ */ >++#define __BSD_VISIBLE 1 >++#include <stdlib.h> >++#define luai_makeseed() cast(unsigned int, arc4random()) >++ >+ #if !defined(luai_makeseed) >+ #include <time.h> >+ #define luai_makeseed() cast(unsigned int, time(NULL)) >+ #endif >diff -ruN lua53.orig/files/patch-src__lstate.c lua53/files/patch-src__lstate.c >--- lua53.orig/files/patch-src__lstate.c 1970-01-01 03:00:00.000000000 +0300 >+++ lua53/files/patch-src__lstate.c 2015-04-16 14:22:50.000000000 +0300 >@@ -0,0 +1,15 @@ >+--- src/lstate.c.orig 2014-11-02 21:33:33.000000000 +0200 >++++ src/lstate.c 2015-04-16 14:22:07.000000000 +0300 >+@@ -43,8 +43,12 @@ >+ /* >+ ** a macro to help the creation of a unique random seed when a state is >+ ** created; the seed is used to randomize hashes. >+ */ >++#define __BSD_VISIBLE 1 >++#include <stdlib.h> >++#define luai_makeseed() cast(unsigned int, arc4random()) >++ >+ #if !defined(luai_makeseed) >+ #include <time.h> >+ #define luai_makeseed() cast(unsigned int, time(NULL)) >+ #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199480
:
155642
|
164875