trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ryzuo <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #650: [TRAFODION-2034] fix bug that odb wil...
Date Wed, 10 Aug 2016 03:41:13 GMT
Github user ryzuo commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/650#discussion_r74181320
  
    --- Diff: core/conn/odb/src/odb.c ---
    @@ -9889,6 +9889,7 @@ static void Oextract(int eid)
                 if ( etab[eid].fho ) {
                     (*hdfswrite)(hfs, etab[eid].fho, (void *)xbuff, xbuffl);
                 } else {
    +                etab[eid].fo = stdout;
    --- End diff --
    
    If the file handler is null, then we may don't need to force to write the message to output.
If it has to(the message is really important), a better and professional way to ensure it
happen is to initialize the fields of etab when it is allocated. I noticed lots of the fields
are pointers, to initialize them requires a lots of work, but it is the safe and professional
way.
    
    etab is allocated in etabnew() at line 5974, after the call of realloc and tested no NULL,
the next thing should be initialize them all, especially the pointer fields.
    
    @xwq You are more familiar with ODB than I am, any comments?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message