OSDN Git Service

Fixed buffer over run of not enough array allocation for object flags by static number
authoriks <iks@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 13 Jun 2013 01:47:02 +0000 (01:47 +0000)
committeriks <iks@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 13 Jun 2013 01:47:02 +0000 (01:47 +0000)
src/artifact.c
src/dungeon.c
src/object1.c

index 5fe1017..2e6d5ac 100644 (file)
@@ -2058,7 +2058,7 @@ const activation_type* find_activation_info(object_type *o_ptr)
 /* Dragon breath activation */
 static bool activate_dragon_breath(object_type *o_ptr)
 {
-       u32b flgs[4]; /* for resistance flags */
+       u32b flgs[TR_FLAG_SIZE]; /* for resistance flags */
        int type[20];
        cptr name[20];
        int i, dir, t, n = 0;
index d02e03d..9cd94fe 100644 (file)
@@ -1535,7 +1535,7 @@ static object_type *choose_cursed_obj_name(u32b flag)
                                        (flag == TRC_SLOW_REGEN) )
                {
                        u32b cf;
-                       u32b flgs[4];
+                       u32b flgs[TR_FLAG_SIZE];
                        object_flags(o_ptr, flgs);
                        switch (flag)
                        {
index 469aa10..2bfaa0f 100644 (file)
@@ -333,7 +333,7 @@ void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
 static cptr item_activation_dragon_breath(object_type *o_ptr)
 {
        static char desc[256];
-       u32b flgs[4]; /* for resistance flags */
+       u32b flgs[TR_FLAG_SIZE]; /* for resistance flags */
        int i, n = 0;
 
        object_flags(o_ptr, flgs);