VMS rand: assign before check, not the other way around
authorRichard Levitte <levitte@openssl.org>
Tue, 8 May 2018 18:15:27 +0000 (20:15 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 8 May 2018 18:56:32 +0000 (20:56 +0200)
items->ile3$w_code was checked before it was assigned its value...

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6200)

crypto/rand/rand_vms.c

index 0037466..b263f94 100644 (file)
@@ -277,13 +277,13 @@ static size_t prepare_item_list(const struct item_st *items_input,
 
     for (; items_input_num-- > 0; items_input++, items++) {
 
+        items->ile3$w_code = items_input->code;
         /* Special treatment of JPI$_FINALEXC */
         if (items->ile3$w_code == JPI$_FINALEXC)
             items->ile3$w_length = 4;
         else
             items->ile3$w_length = items_input->length;
 
-        items->ile3$w_code = items_input->code;
         items->ile3$ps_bufaddr = databuffer;
         items->ile3$ps_retlen_addr = 0;