[Groonga-commit] groonga/groonga at b515a96 [master] schema: fix a bug calling strcpy against not nul terminated string

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Oct 20 22:25:39 JST 2015


Kouhei Sutou	2015-10-20 22:25:39 +0900 (Tue, 20 Oct 2015)

  New Revision: b515a96fc22bfc9fb12cee98aa752b397a45b988
  https://github.com/groonga/groonga/commit/b515a96fc22bfc9fb12cee98aa752b397a45b988

  Message:
    schema: fix a bug calling strcpy against not nul terminated string

  Modified files:
    lib/proc.c
    test/command/suite/schema/tables/columns/type/index.expected

  Modified: lib/proc.c (+1 -0)
===================================================================
--- lib/proc.c    2015-10-20 17:20:46 +0900 (1ff0aa3)
+++ lib/proc.c    2015-10-20 22:25:39 +0900 (436c0c5)
@@ -7925,6 +7925,7 @@ proc_schema_column_output_sources(grn_ctx *ctx, grn_obj *column)
       char name[GRN_TABLE_MAX_KEY_SIZE];
       unsigned int name_size;
       name_size = grn_obj_name(ctx, source, name, GRN_TABLE_MAX_KEY_SIZE);
+      name[name_size] = '\0';
       grn_strcat(name, GRN_TABLE_MAX_KEY_SIZE, "._key");
       GRN_OUTPUT_CSTR(name);
     } else {

  Modified: test/command/suite/schema/tables/columns/type/index.expected (+1 -1)
===================================================================
--- test/command/suite/schema/tables/columns/type/index.expected    2015-10-20 17:20:46 +0900 (41e2767)
+++ test/command/suite/schema/tables/columns/type/index.expected    2015-10-20 22:25:39 +0900 (f4d7619)
@@ -302,7 +302,7 @@ schema
               {
                 "name": "_key",
                 "table": "Posts",
-                "full_name": "Posts._key"
+                "full_name": "Posts._key"
               },
               {
                 "name": "title",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index