Github user paul-guo- commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1243#discussion_r118222840
  
    --- Diff: src/backend/executor/nodeShareInputScan.c ---
    @@ -552,11 +551,59 @@ static void sisc_lockname(char* p, int size, int 
share_id, const char* name)
        }
     }
     
    +
    +char *joint_lock_file_name(ShareInput_Lk_Context *lk_ctxt, char *name)
    +{
    +   char *lock_file = palloc0(sizeof(char) * MAXPGPATH);
    +
    +   if(strncmp("writer", name, 6) ==0 )
    +   {
    +           strncat(lock_file, lk_ctxt->lkname_ready, 
strlen(lk_ctxt->lkname_ready));
    --- End diff --
    
    The strncat usage is not correct. It should be
                strncat(lock_file, lk_ctxt->lkname_ready, MAXPGPATH - 
strlen(lock_file) - 1);
    
    From the manpage.
         strncat(char *restrict s1, const char *restrict s2, size_t n);
         The strncat() function appends not more than n characters from s2, and 
then adds a terminating `\0'.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to