[gnus git] branch master updated: n0-17-186-gbbd0409 =1= (message-unique-id): Don't use the undocumented return value from (random t)

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  bbd0409b70750925c511f4a93c7d41d4154b27d3 (commit)
      from  b68284cd7f7493ce930a73229eeb1e6784838ce0 (commit)


- Log -----------------------------------------------------------------
commit bbd0409b70750925c511f4a93c7d41d4154b27d3
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Tue Jul 19 17:26:59 2011 +0200

    (message-unique-id): Don't use the undocumented return value from (random t)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f795e3f..eca7490 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-19  Lars Magne Ingebrigtsen  <[email protected]>
+
+	* message.el (message-unique-id): Don't use the undocumented return
+	value from (random t) (bug#9118).
+
 2011-07-16  Lars Magne Ingebrigtsen  <[email protected]>
 
 	* message.el (message-auto-save-directory): If the ~/Mail directory
diff --git a/lisp/message.el b/lisp/message.el
index cdc41ea..a0ee4c3 100644
--- a/lisp/message.el
+++ b/lisp/message.el
@@ -4829,7 +4829,9 @@ Do not use this for anything important, it is cryptographically weak."
   (require 'sha1)
   (let (sha1-maximum-internal-length)
     (sha1 (concat (message-unique-id)
-		  (format "%x%x%x" (random) (random t) (random))
+		  (format "%x%x%x" (random)
+			  (progn (random t) (random))
+			  (random))
 		  (prin1-to-string (recent-keys))
 		  (prin1-to-string (garbage-collect))))))
 
@@ -5532,10 +5534,12 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
 ;; You might for example insert a "." somewhere (not next to another dot
 ;; or string boundary), or modify the "fsf" string.
 (defun message-unique-id ()
+  (random t)
   ;; 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)))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog  |    5 +++++
 lisp/message.el |    8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.