From acf40be97e28020e55e2b1ab70e33dd68361306d Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Wed, 2 Feb 2011 09:59:49 -0800 Subject: [PATCH] Fix inner loop index variable. i and j are too close together ;) Before this fix, j would keep increasing well beyond in_len, and lead to segfaults. --- src/test/base64.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/base64.cc b/src/test/base64.cc index e3b58c0c83052..0ff580c51b0f8 100644 --- a/src/test/base64.cc +++ b/src/test/base64.cc @@ -44,7 +44,7 @@ TEST(RoundTrip, RandomRoundTrips) { char in[IN_MAX]; memset(in, 0, sizeof(in)); - for (int j = 0; i < in_len; ++j) { + for (int j = 0; j < in_len; ++j) { in[j] = rand_r(&seed) % 0xff; } char out[OUT_MAX]; -- 2.39.5