eo parser - fix buffer size warning for snprintf truncation
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 7 Nov 2018 09:44:42 +0000 (09:44 +0000)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Tue, 20 Nov 2018 06:56:20 +0000 (15:56 +0900)
make buffers bigger so it can't be truncated.

src/lib/eolian/eo_parser.c

index c8b7f14..e496982 100644 (file)
@@ -85,7 +85,7 @@ check_match(Eo_Lexer *ls, int what, int who, int where, int col)
           error_expected(ls, what);
         else
           {
-             char  buf[256];
+             char  buf[256 + 256 + 128];
              char tbuf[256];
              char vbuf[256];
              eo_lexer_token_to_str(what, tbuf);
@@ -152,7 +152,7 @@ end:
 static void
 redef_error(Eo_Lexer *ls, Eolian_Object *obj, Eolian_Object *nobj)
 {
-   char buf[256], fbuf[256] = { '\0' };
+   char buf[256 + 128], fbuf[256] = { '\0' };
    if (ls->filename != obj->file)
      snprintf(fbuf, sizeof(fbuf), "%s:%d:%d", obj->file, obj->line, obj->column);
    else