[ 
https://issues.apache.org/jira/browse/TS-3816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15359632#comment-15359632
 ] 

ASF GitHub Bot commented on TS-3816:
------------------------------------

Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/783#discussion_r69355867
  
    --- Diff: proxy/http/HttpTransact.cc ---
    @@ -249,7 +249,7 @@ find_server_and_update_current_info(HttpTransact::State 
*s)
       int host_len;
       const char *host = s->hdr_info.client_request.host_get(&host_len);
     
    -  if (ptr_len_cmp(host, host_len, local_host_ip_str, 
sizeof(local_host_ip_str) - 1) == 0) {
    +  if (memcmp(host, local_host_ip_str, host_len) == 0) {
    --- End diff --
    
    What happens if ``host_len`` is longer than ``sizeof(local_host_ip_str)``?


> Should we replace ptr_len_cmp() with memcmp() consistently?
> -----------------------------------------------------------
>
>                 Key: TS-3816
>                 URL: https://issues.apache.org/jira/browse/TS-3816
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Leif Hedstrom
>            Assignee: Tyler Stroh
>              Labels: newbie++
>             Fix For: sometime
>
>
> In most places, we already use memcmp(), but we have our own implementation / 
> wrapper named ptr_len_cmp(), which is used in a few places. This seems rather 
> inconsistent, so either we use ptr_len_cmp() consistently, or just use 
> memcmp() across the board.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to