GNU bug report logs - #9118
23.3.50; Don't seed the RNG in message-unique-id

Previous Next

Packages: emacs, gnus;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Mon, 18 Jul 2011 16:43:02 UTC

Severity: minor

Tags: wontfix

Found in version 23.3.50

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Leo <sdl.web <at> gmail.com>
To: 9118 <at> debbugs.gnu.org
Cc: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: bug#9118: 23.3.50; Don't seed the RNG in message-unique-id
Date: Tue, 19 Jul 2011 00:42:10 +0800
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




This bug report was last modified 13 years and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.