unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9118: 23.3.50; Don't seed the RNG in message-unique-id
@ 2011-07-18 16:42 Leo
  2011-07-19 14:57 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Leo @ 2011-07-18 16:42 UTC (permalink / raw)
  To: 9118; +Cc: Lars Magne Ingebrigtsen

Function message-unique-id seeds the RNG every time it runs and relies
on its undocumented return value. Should something like this be applied?

--- a/message.el
+++ b/message.el
@@ -5484,7 +5484,8 @@
   ;; Don't use microseconds from (current-time), they may be unsupported.
   ;; Instead we use this randomly inited counter.
   (setq message-unique-id-char
-	(% (1+ (or message-unique-id-char (logand (random t) (1- (lsh 1 20)))))
+	(% (1+ (or message-unique-id-char
+		   (logand (random most-positive-fixnum) (1- (lsh 1 20)))))
 	   ;; (current-time) returns 16-bit ints,
 	   ;; and 2^16*25 just fits into 4 digits i base 36.
 	   (* 25 25)))

Diff finished.  Tue Jul 19 00:34:45 2011

Leo





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-07-31 16:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-18 16:42 bug#9118: 23.3.50; Don't seed the RNG in message-unique-id Leo
2011-07-19 14:57 ` Lars Magne Ingebrigtsen
2011-07-19 15:14   ` Leo
2011-07-19 15:24     ` Lars Magne Ingebrigtsen
2011-07-19 15:44       ` Leo
2011-07-19 15:49         ` Lars Magne Ingebrigtsen
2011-07-20  2:12           ` Leo
2011-07-20 20:28             ` Lars Magne Ingebrigtsen
2011-07-21  4:45               ` Leo
2011-07-21 11:57                 ` Juanma Barranquero
2011-07-21 15:58                   ` Leo
2011-07-31 15:39                     ` Lars Magne Ingebrigtsen
2011-07-31 16:02                       ` Leo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).