]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
Ensure that bmk_dmesg stays null-terminated.
authorAntti Kantee <pooka@iki.fi>
Sun, 19 Apr 2015 16:51:44 +0000 (16:51 +0000)
committerAntti Kantee <pooka@iki.fi>
Sun, 19 Apr 2015 16:51:44 +0000 (16:51 +0000)
lib/librumprun_core/subr_prf.c

index 9b0c135da7d84621962463a16ee6ab76823cbcca..415c62bb21cb5e11fad399af0e46b319293bf6fc 100644 (file)
@@ -113,7 +113,7 @@ cons_putchar(int c, int flags)
 {
 
        bmk_dmesg[bmk_dmesgoff] = c;
-       if (++bmk_dmesgoff == sizeof(bmk_dmesg))
+       if (++bmk_dmesgoff == sizeof(bmk_dmesg)-1)
                bmk_dmesgoff = 0;
        (*v_putc)(c);
 }