Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 25 Mar 2013 02:07:59 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Bug in dynamic (was: new warnings with gcc 4.8.0)

On 24 Mar, 2013, at 9:45 , Dhiru Kholia <dhiru.kholia@...il.com> wrote:
> I tried to build unstable-jumbo with gcc 4.8.0 and got some new
> warnings.

> dynamic_fmt.c: In function ‘init’:
> dynamic_fmt.c:842:27: warning: iteration 8u invokes undefined behavior [-Waggressive-loop-optimizations]
>     total_len2[i*MMX_COEF] = 32;

This one is an actual bug that must be fixed:

   429  static unsigned int total_len2[BLOCK_LOOPS];
   ...
   833          if (curdat.input2_set_len32) {
   834                  for (i = 0; i < MAX_KEYS_PER_CRYPT_X86; ++i)
   835                          total_len2_X86[i] = 32;
   836  #ifdef MMX_COEF
   837                  for (i = 0; i < BLOCK_LOOPS; ++i) {
   838                          input_buf2[i].c[GETPOS(32,0)] = 0x80;
   839                          input_buf2[i].c[GETPOS(57,0)] = 0x1;
   840                          input_buf2[i].c[GETPOS(32,1)] = 0x80;
   841                          input_buf2[i].c[GETPOS(57,1)] = 0x1;
   842                          total_len2[i*MMX_COEF] = 32;
   843                          total_len2[i*MMX_COEF+1] = 32;
   844  #if (MMX_COEF==4)
   845                          input_buf2[i].c[GETPOS(32,2)] = 0x80;
   846                          input_buf2[i].c[GETPOS(57,2)] = 0x1;
   847                          input_buf2[i].c[GETPOS(32,3)] = 0x80;
   848                          input_buf2[i].c[GETPOS(57,3)] = 0x1;
   849                          total_len2[i*MMX_COEF+2] = 32;
   850                          total_len2[i*MMX_COEF+3] = 32;
   851  #endif
   852                  }
   853  #endif
   854          }

total_len2 is defined as [BLOCK_LOOPS] but in the loop it's used as if it were MMX_COEF*BLOCK_LOOPS. I'm not sure in what end it's wrong - Jim?

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.