ycaibb opened a new issue #289:
URL: https://github.com/apache/celix/issues/289


   
   
   
   
   Dear developers:
          Our static tool reports a null pointer dereference on this 
[method.](https://github.com/apache/celix/blob/master/libs/framework/src/manifest_parser.c#L407)
 The reason is `clauses`can be null at 
[here](https://github.com/apache/celix/blob/master/libs/framework/src/manifest_parser.c#L414).
 Can linked_list_pt manifestParser_parseStandardHeader return NULL?  Thank you 
for your confirmation.
   
   
   ```
   static linked_list_pt manifestParser_parseStandardHeader(const char * 
header) {
        linked_list_pt clauseStrings = NULL;
        linked_list_pt completeList = NULL;
   
        if(header != NULL && strlen(header)==0){
                return NULL;
        }
   
        if (linkedList_create(&completeList) == CELIX_SUCCESS) {
                if(header!=NULL){
                        char *hdr = strdup(header);
                        clauseStrings = 
manifestParser_parseDelimitedString(hdr, ",");
                        free(hdr);
                        if (clauseStrings != NULL) {
                                int i;
                                for (i = 0; i < linkedList_size(clauseStrings); 
i++) {
                                        char *clauseString = (char *) 
linkedList_get(clauseStrings, i);
                                        linkedList_addElement(completeList, 
manifestParser_parseStandardHeaderClause(clauseString));
                                        free(clauseString);
                                }
                                linkedList_destroy(clauseStrings);
                        }
                }
   
        }
   
        return completeList;
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to