summaryrefslogtreecommitdiffstats
path: root/crypto/buffer
diff options
context:
space:
mode:
authorBen Laurie <ben@links.org>2014-05-22 10:11:40 +0100
committerBen Laurie <ben@links.org>2014-05-22 10:12:10 +0100
commitd77501d8fd1a49ff82e2824ded6f341f4fc8307a (patch)
tree4493994994385d888fd44d986a2bbdcc79ff9b14 /crypto/buffer
parent15e4565984eaab1d5d111dcf74e67faa111c5789 (diff)
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 60dab54344..12ef1fa064 100644
--- a/crypto/buffer/buf_str.c
+++ b/crypto/buffer/buf_str.c
@@ -64,7 +64,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;