trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] trafodion pull request #1394: [TRAFODION-2891] fix the bufoverrun Critical e...
Date Thu, 18 Jan 2018 01:19:12 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1394#discussion_r162226893
  
    --- Diff: core/conn/odb/src/odb.c ---
    @@ -5313,7 +5313,7 @@ static void etabadd(char type, char *run, int id)
                         }
                     }
                     if ( etab[no].type == 'e' ) { /* name & create output file */
    -                    for ( i = j = 0; etab[no].tgt[i] && i < sizeof(buff);
i++ ) {
    +                    for ( i = j = 0; i < sizeof(buff) && etab[no].tgt[i];
i++ ) {
    --- End diff --
    
    I tried to make sense of this too. It looks like etab[no].tgt is populated in function
parseopt from some string buffer; I can't tell if it is buff (which is a static variable declared
as a char[256]) or something else. My suspicion is that the test "i < sizeof(buff)" has
nothing to do with etab[no].tgt but rather some other buffer being copied to. In any case,
reversing the order of these tests seems harmless.


---

Mime
View raw message