import from HEAD:
authorfcusack <fcusack>
Thu, 9 Feb 2006 23:28:46 +0000 (23:28 +0000)
committerfcusack <fcusack>
Thu, 9 Feb 2006 23:28:46 +0000 (23:28 +0000)
otp_authenticate(): malloc raw_state before using it

1  2 
src/modules/rlm_otp/otp_rlm.c

@@@ -498,9 -498,11 +498,11 @@@ otp_authenticate(void *instance, REQUES
           * Verify the state.
           */
  
-         /* ASCII decode */
          rad_state = rad_malloc(e_length + 1);
 -        (void) memcpy(rad_state, vp->vp_strvalue, vp->length);
+         raw_state = rad_malloc(e_length / 2);
+         /* ASCII decode */
 +        (void) memcpy(rad_state, vp->strvalue, vp->length);
          rad_state[e_length] = '\0';
          (void) otp_keystring2keyblock(rad_state, raw_state);
          free(rad_state);