pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/52293 Assertion failure in libterminfo _ti_encode_buf_16



The following reply was made to PR pkg/52293; it has been noted by GNATS.

From: Roy Marples <roy%marples.name@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: lib/52293 Assertion failure in libterminfo _ti_encode_buf_16
Date: Sat, 20 Jun 2020 10:43:14 +0100

 I think this is the wrong fix.
 
 All callers of _ti_encode_buf_N pass int as the second arg, so surely the 
 correct fix it to accept int?
 The uintN_t casting is already done inside it.
 
 Does this fix it for you?
 
 Roy
 
 Index: term_private.h
 ===================================================================
 RCS file: /cvsroot/src/lib/libterminfo/term_private.h,v
 retrieving revision 1.18
 diff -u -p -r1.18 term_private.h
 --- term_private.h      29 Mar 2020 21:46:22 -0000      1.18
 +++ term_private.h      20 Jun 2020 09:42:48 -0000
 @@ -252,7 +252,7 @@ _ti_encode_count_str(char **cap, const c
   }
 
   static __inline void
 -_ti_encode_buf_16(TBUF *tbuf, size_t num)
 +_ti_encode_buf_16(TBUF *tbuf, int num)
   {
          _DIAGASSERT(num <= UINT16_MAX);
          le16enc(tbuf->buf + tbuf->bufpos, (uint16_t)num);
 @@ -260,7 +260,7 @@ _ti_encode_buf_16(TBUF *tbuf, size_t num
   }
 
   static __inline void
 -_ti_encode_buf_32(TBUF *tbuf, size_t num)
 +_ti_encode_buf_32(TBUF *tbuf, int num)
   {
          _DIAGASSERT(num <= UINT32_MAX);
          le32enc(tbuf->buf + tbuf->bufpos, (uint32_t)num);
 @@ -276,7 +276,7 @@ _ti_encode_buf_count_str(TBUF *tbuf, con
   }
 
   static __inline void
 -_ti_encode_buf_num(TBUF *tbuf, size_t num, int rtype)
 +_ti_encode_buf_num(TBUF *tbuf, int num, int rtype)
   {
          if (rtype == TERMINFO_RTYPE_O1) {
                  if (num > INT16_MAX)
 


Home | Main Index | Thread Index | Old Index