Skip to content
  • Nick Mathewson's avatar
    bc91cb6e
    Use strlcpy when copying node IDs into measured_bw_line_t · bc91cb6e
    Nick Mathewson authored
    We were using strncpy before, which isn't our style for stuff like
    this.
    
    This isn't a bug, though: before calling strncpy, we were checking
    that strlen(src) was indeed == HEX_DIGEST_LEN, which is less than
    sizeof(dst), so there was no way we could fail to NUL-terminate.
    Still, strncpy(a,b,sizeof(a)) is an idiom that we ought to squash
    everyplace.
    
    Fixes CID #427.
    bc91cb6e
    Use strlcpy when copying node IDs into measured_bw_line_t
    Nick Mathewson authored
    We were using strncpy before, which isn't our style for stuff like
    this.
    
    This isn't a bug, though: before calling strncpy, we were checking
    that strlen(src) was indeed == HEX_DIGEST_LEN, which is less than
    sizeof(dst), so there was no way we could fail to NUL-terminate.
    Still, strncpy(a,b,sizeof(a)) is an idiom that we ought to squash
    everyplace.
    
    Fixes CID #427.
Loading