providers/common/macs/kmac_prov.c:305: error: BUFFER_OVERRUN_L2
  Offset: [1, 8] Size: 3 by call to `right_encode`.
Showing all 10 steps of the trace


providers/common/macs/kmac_prov.c:293:1: Array declaration
291.   }
292.   
293. > static int kmac_final(void *vmacctx, unsigned char *out, size_t *outl,
294.                         size_t outsize)
295.   {

providers/common/macs/kmac_prov.c:305:10: Call
303.       lbits = (kctx->xof_mode ? 0 : (kctx->out_len * 8));
304.   
305.       ok = right_encode(encoded_outlen, &len, lbits)
                ^
306.           && EVP_DigestUpdate(ctx, encoded_outlen, len)
307.           && EVP_DigestFinalXOF(ctx, out, kctx->out_len);

providers/common/macs/kmac_prov.c:423:24: <Offset trace>
421.   static int right_encode(unsigned char *out, int *out_len, size_t bits)
422.   {
423.       unsigned int len = get_encode_size(bits);
                              ^
424.       int i;
425.   

providers/common/macs/kmac_prov.c:423:24: Call
  421.   static int right_encode(unsigned char *out, int *out_len, size_t bits)
  422.   {
  423.       unsigned int len = get_encode_size(bits);
                                ^
  424.       int i;
  425.   

providers/common/macs/kmac_prov.c:401:5: Assignment
    399.   static unsigned int get_encode_size(size_t bits)
    400.   {
    401.       unsigned int cnt = 0, sz = sizeof(size_t);
               ^
    402.   
    403.       while (bits && (cnt < sz)) {

providers/common/macs/kmac_prov.c:410:5: Assignment
    408.       if (cnt == 0)
    409.           cnt = 1;
    410.       return cnt;
               ^
    411.   }
    412.   

providers/common/macs/kmac_prov.c:423:5: Assignment
  421.   static int right_encode(unsigned char *out, int *out_len, size_t bits)
  422.   {
  423.       unsigned int len = get_encode_size(bits);
             ^
  424.       int i;
  425.   

providers/common/macs/kmac_prov.c:421:1: <Length trace>
419.    *
420.    */
421. > static int right_encode(unsigned char *out, int *out_len, size_t bits)
422.   {
423.       unsigned int len = get_encode_size(bits);

providers/common/macs/kmac_prov.c:421:1: Parameter `*out`
  419.    *
  420.    */
  421. > static int right_encode(unsigned char *out, int *out_len, size_t bits)
  422.   {
  423.       unsigned int len = get_encode_size(bits);

providers/common/macs/kmac_prov.c:436:5: Array access: Offset: [1, 8] Size: 3 by call to `right_encode` 
  434.       }
  435.       /* Tack the length onto the end */
  436.       out[len] = (unsigned char)len;
             ^
  437.   
  438.       /* The Returned length includes the tacked on byte */
