Skip to content
  • Jindrich Novy's avatar
    Use secure string copy to avoid overflow · 2d79c0b7
    Jindrich Novy authored
    
    
    Error: STRING_OVERFLOW (CWE-120): [#def2]
    libslirp-4.3.0/src/ip_icmp.c:277: fixed_size_dest: You might overrun the 20-character fixed-size string "bufa" by copying the return value of "inet_ntoa" without checking the length.
      275|       if (slirp_debug & DBG_MISC) {
      276|           char bufa[20], bufb[20];
      277|->         strcpy(bufa, inet_ntoa(ip->ip_src));
      278|           strcpy(bufb, inet_ntoa(ip->ip_dst));
      279|           DEBUG_MISC(" %.16s to %.16s", bufa, bufb);
    
    Error: STRING_OVERFLOW (CWE-120): [#def3]
    libslirp-4.3.0/src/ip_icmp.c:278: fixed_size_dest: You might overrun the 20-character fixed-size string "bufb" by copying the return value of "inet_ntoa" without checking the length.
      276|           char bufa[20], bufb[20];
      277|           strcpy(bufa, inet_ntoa(ip->ip_src));
      278|->         strcpy(bufb, inet_ntoa(ip->ip_dst));
      279|           DEBUG_MISC(" %.16s to %.16s", bufa, bufb);
      280|       }
    
    Signed-off-by: default avatarJindrich Novy <jnovy@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    2d79c0b7
Loading