arch/arm/mach-omap2/mux.c: Off by one error

From: d binderman
Date: Sun Jan 31 2010 - 07:17:06 EST

Hello there,

I just ran the sourceforge tool cppcheck over the source code of the
new Linux kernel 2.6.33-rc6

It said

[./arm/mach-omap2/mux.c:492]: (error) Buffer access out-of-bounds

The source code is

        char mode[14];
        int i = -1;

        sprintf(mode, "OMAP_MUX_MODE%d", val & 0x7);

13 characters + 1 digit + 1 zero byte is more than 14 characters.

Suggest new code

        char mode[15];
        int i = -1;

        sprintf(mode, "OMAP_MUX_MODE%d", val & 0x7);


David Binderman

Tell us your greatest, weirdest and funniest Hotmail stories
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at