From 87bf09c82cea7b63cb51d3b72581c3df742bf7ce Mon Sep 17 00:00:00 2001 From: Nelson Ferreira Date: Wed, 11 Jan 2012 22:51:06 -0500 Subject: [PATCH] Coverity: Reverse Negative: CID:209 * src/mule/file-coding.c (coding_system_from_mask): Make sure cat is >=0 before dereferencing in the loop. Signed-off-by: Nelson Ferreira --- src/mule/file-coding.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mule/file-coding.c b/src/mule/file-coding.c index 79c6fae..eeb28a1 100644 --- a/src/mule/file-coding.c +++ b/src/mule/file-coding.c @@ -1820,6 +1820,8 @@ static Lisp_Object coding_system_from_mask(int mask) the first one that is allowed. */ for (i = 0; i < CODING_CATEGORY_LAST; i++) { cat = fcd->coding_category_by_priority[i]; + if (cat<0) + continue; if ((mask & (1 << cat)) && !NILP(fcd->coding_category_system[cat])) break; -- 2.25.1