Coverity: Reverse Negative: CID:209
authorNelson Ferreira <nelson.ferreira@ieee.org>
Thu, 12 Jan 2012 03:51:06 +0000 (22:51 -0500)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Thu, 12 Jan 2012 03:51:06 +0000 (22:51 -0500)
* src/mule/file-coding.c (coding_system_from_mask): Make sure cat
is >=0 before dereferencing in the loop.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/mule/file-coding.c

index 79c6fae..eeb28a1 100644 (file)
@@ -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;