You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2020/10/29 11:50:22 UTC
[GitHub] [celix] ycaibb opened a new issue #289: Possible NULL pointer dereference in the method manifestParser_parseExportHeader??
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:
users@infra.apache.org
[GitHub] [celix] pnoltes commented on issue #289: Possible NULL pointer dereference in the method manifestParser_parseExportHeader??
Posted by GitBox <gi...@apache.org>.
pnoltes commented on issue #289:
URL: https://github.com/apache/celix/issues/289#issuecomment-907854527
Is it ok to close this issue?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [celix] ycaibb closed issue #289: Possible NULL pointer dereference in the method manifestParser_parseExportHeader??
Posted by GitBox <gi...@apache.org>.
ycaibb closed issue #289:
URL: https://github.com/apache/celix/issues/289
--
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.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [celix] pnoltes commented on issue #289: Possible NULL pointer dereference in the method manifestParser_parseExportHeader??
Posted by GitBox <gi...@apache.org>.
pnoltes commented on issue #289:
URL: https://github.com/apache/celix/issues/289#issuecomment-907854438
Theoretically `clauses` can be null if the underlining call to `linkedList_create` fails.
This would mean the malloc in the linkedList_create should fail at:
https://github.com/apache/celix/blob/0729c4dfaa6b45f436e41f13ebe71960c746d109/libs/utils/src/linked_list.c#L35
Celix has the approach not to check malloc, because in practices malloc calls will always return a value (pointer to mem or virtual pointer) and if memory becomes an issue the oom killer will kill the process.
https://linux-mm.org/OOM_Killer
So in short, no this cannot happen.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [celix] ycaibb commented on issue #289: Possible NULL pointer dereference in the method manifestParser_parseExportHeader??
Posted by GitBox <gi...@apache.org>.
ycaibb commented on issue #289:
URL: https://github.com/apache/celix/issues/289#issuecomment-907972675
@pnoltes OK, Thank you very much for your reply!
--
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.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [celix] ycaibb commented on issue #289: Possible NULL pointer dereference in the method manifestParser_parseExportHeader??
Posted by GitBox <gi...@apache.org>.
ycaibb commented on issue #289:
URL: https://github.com/apache/celix/issues/289#issuecomment-904460064
HI, any reply would be highly appreciated! @pnoltes @abroekhuis
--
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.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org