Coverity: Negative Returns: CID 121
authorNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 20 Jan 2012 03:34:49 +0000 (22:34 -0500)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 20 Jan 2012 03:34:49 +0000 (22:34 -0500)
* src/ui/TTY/objects-tty.c (tty_font_spec_matches_charset): Make
sure to abort in case of invariant violation.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/ui/TTY/objects-tty.c

index 0be74fa..636dcfc 100644 (file)
@@ -501,7 +501,12 @@ tty_font_spec_matches_charset(struct device *d, Lisp_Object charset,
        if (!the_nonreloc)
                the_nonreloc = XSTRING_DATA(reloc);
        fixup_internal_substring(nonreloc, reloc, offset, &length);
+
        assert(length>=0);
+       if( length<0 ) {
+               abort();
+       }
+
        the_nonreloc += offset;
 
        if (UNBOUNDP(charset))