Usage of unitialized heap in tic4x_print_cond
authorAlan Modra <amodra@gmail.com>
Sun, 29 Dec 2019 02:26:29 +0000 (12:56 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 29 Dec 2019 11:43:12 +0000 (22:13 +1030)
PR 25319
* tic4x-dis.c (tic4x_print_cond): Init all of condtable.

opcodes/ChangeLog
opcodes/tic4x-dis.c

index 9a1512304270b09c101b564c2ce7d2e89d544569..5187fb2176927e2172ccd87d3682de415525f5de 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-29  Alan Modra  <amodra@gmail.com>
+
+       PR 25319
+       * tic4x-dis.c (tic4x_print_cond): Init all of condtable.
+
 2019-12-27  Jan Beulich  <jbeulich@suse.com>
 
        * i386-dis.c (Jdqw): Define.
index d9f95c94106a5ccb98431c43de8f4db09dbd6717..01cfa1e060ff8258a079c55b2aab00ee585f12ad 100644 (file)
@@ -277,7 +277,7 @@ tic4x_print_cond (struct disassemble_info *info, unsigned int cond)
 
   if (condtable == NULL)
     {
-      condtable = xmalloc (sizeof (tic4x_cond_t *) * 32);
+      condtable = xcalloc (sizeof (tic4x_cond_t *), 32);
       for (i = 0; i < tic4x_num_conds; i++)
        condtable[tic4x_conds[i].cond] = (tic4x_cond_t *)(tic4x_conds + i);
     }
This page took 0.026271 seconds and 4 git commands to generate.