[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] lib: Pufferueberlauf in strnlen



! libc: Fix fuer Pufferueberlauf in strnlen

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/lib/string.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/string.c b/src/lib/string.c
index bbf1a97..3125c2c 100644
--- a/src/lib/string.c
+++ b/src/lib/string.c
@@ -34,8 +34,8 @@
 size_t strnlen(const char *s, size_t maxlen)
 {
     size_t len = 0;
-    
-    while (*s++ && maxlen--) {
+
+    while (maxlen-- && *s++) {
         len++;
     }
 
-- 
1.6.0.2