Changeset 560 for trunk/src


Ignore:
Timestamp:
Oct 31, 2020, 11:44:21 PM (4 years ago)
Author:
katerina
Message:

Fix for ticket #449 (gcc 10 compile issues).

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_audit.c

    r541 r560  
    7575
    7676  if (auparse_find_field(au, _("success")))
    77     strncpy(state->success, auparse_interpret_field(au), REC_SIZE_SUCCESS);
     77    sl_strlcpy(state->success, auparse_interpret_field(au), REC_SIZE_SUCCESS);
    7878
    7979  if (auparse_find_field(au, "uid"))
  • trunk/src/sh_dbIO.c

    r550 r560  
    227227    {
    228228      /* alignment problem */
    229       unsigned char swap;
    230       static unsigned short ooop;
    231       unsigned char * ii;
    232       ooop = *iptr;
    233       ii = (unsigned char *) &ooop;
    234       swap = ii[0]; ii[0] = ii[1]; ii[1] = swap;
     229      static unsigned short ooop = *iptr;
     230      unsigned short hi   = (ooop & 0xff00);
     231      unsigned short lo   = (ooop & 0xff);
     232      ooop = (lo << 8) | (hi >> 8);
    235233      return &ooop;
    236234    }
  • trunk/src/sh_filter.c

    r541 r560  
    115115  }
    116116
     117  /* cppcheck-suppress uninitvar */
    117118  i = *ntok;
    118119  if (i == SH_FILT_NUM) {
  • trunk/src/sh_ipvx.c

    r541 r560  
    201201  static char ipbuf[SH_IP_BUF];
    202202
     203  memset(&ss, 0, sizeof(struct sh_sockaddr));
    203204  sh_ipvx_save(&ss, sa_family, sa);
    204205  sh_ipvx_ntoa (ipbuf, sizeof(ipbuf), &ss);
  • trunk/src/sh_portcheck.c

    r541 r560  
    601601  struct sh_portentry * ptr = *head;
    602602  struct sh_portentry * pre = *head;
    603   char errbuf[256];
     603  char errbuf[512];
    604604
    605605  /* Take the address to keep gcc from putting them into registers.
     
    731731{
    732732  struct sh_portentry * portent;
    733   char errbuf[256];
     733  char errbuf[512];
    734734
    735735 
  • trunk/src/sh_srp.c

    r544 r560  
    119119            get_str_internal = ptr;
    120120          else
    121             { free(get_str_internal); get_str_internal = NULL; }
     121            {
     122              /* "If realloc() fails, the original block is left untouched;
     123               * it is not freed or moved." */
     124              /* cppcheck-suppress doubleFree */
     125              free(get_str_internal);
     126              get_str_internal = NULL;
     127            }
    122128        }
    123129      if (get_str_internal == NULL)
  • trunk/src/sh_tiger1_64.c

    r481 r560  
    140140#define roundend(a,b,c,x) \
    141141 : "+r" (a), "+r" (b), "+r" (c) \
    142  : "r" (a), "r" (b), "r" (c), "m" (x), "r" (&tiger_table),\
     142 : "g" (a), "g" (b), "g" (c), "m" (x), "r" (&tiger_table),\
    143143  "i" (MASK0), "i" (MASK8), "i" (MASK16), "r" (MASK32), "r" (MASK40), "r" (MASK48) \
    144144 : "3", "%rax","%rbx","%rcx","%rdx","%rsi", "%edi", "%r8"  );
  • trunk/src/sh_utils.c

    r541 r560  
    827827    copy_four ( (unsigned char *) &(cc[i]), h1[i]);
    828828
     829  /* cppcheck-suppress uninitvar */
    829830  h2 = sh_tiger_hash_uint32 ( inner, TIGER_DATA,
    830831                              (unsigned long) KEY_BLOCK+textlen,
     
    833834    copy_four ( (unsigned char *) &(cc[i]), h2[i - (KEY_LEN/8)]);
    834835
     836  /* cppcheck-suppress uninitvar */
    835837  SH_FREE(inner);
    836838 
     
    22012203    SL_RETURN(NULL, _("sh_util_strconcat"));
    22022204
     2205  /* cppcheck-suppress uninitvar */
    22032206  strnew[0] = '\0';
    22042207
Note: See TracChangeset for help on using the changeset viewer.