From f69577ad99f1be21d0c1256167572366fdcb51c2 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 20 May 2016 09:47:59 +0100 Subject: fix range check in olm_*_last_errror --- src/olm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/olm.cpp') diff --git a/src/olm.cpp b/src/olm.cpp index 63f3d83..15c5e83 100644 --- a/src/olm.cpp +++ b/src/olm.cpp @@ -190,7 +190,7 @@ const char * olm_account_last_error( OlmAccount * account ) { unsigned error = unsigned(from_c(account)->last_error); - if (error < sizeof(ERRORS)) { + if (error < (sizeof(ERRORS)/sizeof(ERRORS[0]))) { return ERRORS[error]; } else { return "UNKNOWN_ERROR"; -- cgit v1.2.3