]> granicus.if.org Git - libevent/commitdiff
We should return after arc4random_buf()
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 10 Jul 2013 02:02:43 +0000 (11:02 +0900)
committerMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 10 Jul 2013 02:05:02 +0000 (11:05 +0900)
evutil_rand.c

index 039c74e37c70e07b81427fa006a02c7aa4ce2e61..38814e4cc2865c2eae8a6f08bde90fc854464971 100644 (file)
@@ -67,6 +67,7 @@ ev_arc4random_buf(void *buf, size_t n)
 {
 #if defined(EVENT__HAVE_ARC4RANDOM_BUF) && !defined(__APPLE__)
        arc4random_buf(buf, n);
+       return;
 #else
        unsigned char *b = buf;
 
@@ -79,6 +80,7 @@ ev_arc4random_buf(void *buf, size_t n)
         */
        if (arc4random_buf != NULL) {
                arc4random_buf(buf, n);
+               return;
        }
 #endif
        /* Make sure that we start out with b at a 4-byte alignment; plenty