From 6cfc8add274feadbe9357638ad83c207ddd39f4d Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 10 Aug 2017 12:01:45 +1200 Subject: Fix off-by-one error in cl_error bounds checking --- cl_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_error.c b/cl_error.c index 293a3d8..55b91bd 100644 --- a/cl_error.c +++ b/cl_error.c @@ -77,7 +77,7 @@ static const char *cl_error_strings[] = { const char *get_cl_error_string(cl_int error) { error = -error; - if (error < 0 || error > sizeof(cl_error_strings) / sizeof(const char *)) + if (error < 0 || error >= sizeof(cl_error_strings) / sizeof(const char *)) return "Error value out of bounds"; return cl_error_strings[error]; -- cgit v1.1