summaryrefslogtreecommitdiffstats
path: root/crypto/buffer
diff options
context:
space:
mode:
authorBen Laurie <ben@links.org>2014-05-22 11:11:40 +0200
committerBen Laurie <ben@links.org>2014-05-22 11:13:22 +0200
commiteb33348879938a073a9941e4ca21da21a27e04df (patch)
treec0cddb2a4d98f956c17995dd6aca00d5c1df15bb /crypto/buffer
parentFixed minor copy&paste error, and stray space causing rendering problem (diff)
downloadopenssl-eb33348879938a073a9941e4ca21da21a27e04df.tar.xz
openssl-eb33348879938a073a9941e4ca21da21a27e04df.zip
Check length first in BUF_strnlen().
Diffstat (limited to 'crypto/buffer')
-rw-r--r--crypto/buffer/buf_str.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/buffer/buf_str.c b/crypto/buffer/buf_str.c
index 35e4a2e789..b4ff71ed5a 100644
--- a/crypto/buffer/buf_str.c
+++ b/crypto/buffer/buf_str.c
@@ -66,7 +66,7 @@ size_t BUF_strnlen(const char *str, size_t maxlen)
{
const char *p;
- for (p = str; *p != '\0' && maxlen-- != 0; ++p)
+ for (p = str; maxlen-- != 0 && *p != '\0'; ++p)
;
return p - str;