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

    https://github.com/apache/trafodion/pull/1487#discussion_r176479189
  
    --- Diff: core/conn/odbc/src/odbc/nsksrvr/SrvrMain.cpp ---
    @@ -1427,7 +1437,59 @@ BOOL getInitParamSrvr(int argc, char *argv[], 
SRVR_INIT_PARAM_Def &initParam, ch
                                argEmpty = TRUE;
                                break;
                        }
    -           }
    +           }else
    +        if (strcmp(arg, "-TCPKEEPALIVESTATUS") == 0){
    +            if (++count < argc && argv[count][0] != '-')
    +            {
    +                if (strlen(argv[count]) < sizeof(keepaliveStatus) - 1)
    +                {
    +                    memset(keepaliveStatus, 0, sizeof(keepaliveStatus));
    +                    strncpy(keepaliveStatus, argv[count], 
sizeof(keepaliveStatus));
    --- End diff --
    
    I think you want "sizeof(keepaliveStatus)-1" here. If argv[count] has a 
strlen longer than keepaliveStatus, the first sizeof(keepaliveStatus) bytes 
will be copied here, overwriting all of the bytes previously set to null. (I 
don't know what we do for other parameters. Maybe we tolerate this situation 
today.)


---

Reply via email to