diff options
author | Kim Alvefur <zash@zash.se> | 2019-05-18 18:51:25 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-05-18 18:51:25 +0200 |
commit | 13e3b3fb15cf9bd7cd82b860c7041a6e855bb0e9 (patch) | |
tree | 01ff1fc47ba0dbe948bb7f124872698fc8586498 /util | |
parent | b0459a771b38a2788949810aeb4a06ad32110e15 (diff) | |
download | prosody-13e3b3fb15cf9bd7cd82b860c7041a6e855bb0e9.tar.gz prosody-13e3b3fb15cf9bd7cd82b860c7041a6e855bb0e9.zip |
util.random: Coerce error to string (thanks waqas)
In theory this could happen in an EOF condition, which should be
impossible with a read from /dev/urandom.
Diffstat (limited to 'util')
-rw-r--r-- | util/random.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/random.lua b/util/random.lua index 8ae06b49..51f2747d 100644 --- a/util/random.lua +++ b/util/random.lua @@ -14,7 +14,7 @@ local urandom, urandom_err = io.open("/dev/urandom", "r"); local function bytes(n) local data, err = urandom:read(n); if not data then - error("Unable to retrieve data from secure random number generator (/dev/urandom): "..err); + error("Unable to retrieve data from secure random number generator (/dev/urandom): "..tostring(err)); end return data; end |