Remove possibility of access violation.
1. Test Instr before dereference it in http_RecvPostMessage. (Though it never becomes NULL because NULL is not passed to the static method) 2. Avoid strdup(NULL) in ixmlElement_setAttributeNS. Those are detected by llvm scan-build. (cherry picked from commit a383cbb8e20545222880f064a5b27c15abbf9280)
This commit is contained in:
parent
79d4b583fe
commit
77559473c1
10
ChangeLog
10
ChangeLog
@ -332,6 +332,16 @@ Version 1.8.0
|
|||||||
Version 1.6.18
|
Version 1.6.18
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
|
2012-04-06 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||||
|
|
||||||
|
Remove possibility of access violation.
|
||||||
|
|
||||||
|
1. Test Instr before dereference it in http_RecvPostMessage.
|
||||||
|
(Though it never becomes NULL because NULL is not passed to
|
||||||
|
the static method)
|
||||||
|
2. Avoid strdup(NULL) in ixmlElement_setAttributeNS.
|
||||||
|
Those are detected by llvm scan-build.
|
||||||
|
|
||||||
2012-04-05 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
2012-04-05 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||||
|
|
||||||
SF Bug Tracker id 3507819 - Use of thread-unsafe gmtime() in httpreadwrite.c
|
SF Bug Tracker id 3507819 - Use of thread-unsafe gmtime() in httpreadwrite.c
|
||||||
|
@ -455,11 +455,14 @@ int ixmlElement_setAttributeNS(
|
|||||||
free(attrNode->prefix);
|
free(attrNode->prefix);
|
||||||
}
|
}
|
||||||
/* replace it with the new prefix */
|
/* replace it with the new prefix */
|
||||||
|
if (newAttrNode.prefix != NULL) {
|
||||||
attrNode->prefix = strdup( newAttrNode.prefix );
|
attrNode->prefix = strdup( newAttrNode.prefix );
|
||||||
if (attrNode->prefix == NULL) {
|
if (attrNode->prefix == NULL) {
|
||||||
Parser_freeNodeContent(&newAttrNode);
|
Parser_freeNodeContent(&newAttrNode);
|
||||||
return IXML_INSUFFICIENT_MEMORY;
|
return IXML_INSUFFICIENT_MEMORY;
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
attrNode->prefix = newAttrNode.prefix;
|
||||||
|
|
||||||
if (attrNode->nodeValue != NULL) {
|
if (attrNode->nodeValue != NULL) {
|
||||||
free(attrNode->nodeValue);
|
free(attrNode->nodeValue);
|
||||||
|
@ -1443,7 +1443,7 @@ static int http_RecvPostMessage(
|
|||||||
&parser->msg.msg.buf[parser->entity_start_position + entity_offset],
|
&parser->msg.msg.buf[parser->entity_start_position + entity_offset],
|
||||||
Data_Buf_Size);
|
Data_Buf_Size);
|
||||||
entity_offset += Data_Buf_Size;
|
entity_offset += Data_Buf_Size;
|
||||||
if (Instr->IsVirtualFile) {
|
if (Instr && Instr->IsVirtualFile) {
|
||||||
int n = virtualDirCallback.write(Fp, Buf, Data_Buf_Size);
|
int n = virtualDirCallback.write(Fp, Buf, Data_Buf_Size);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
ret_code = HTTP_INTERNAL_SERVER_ERROR;
|
ret_code = HTTP_INTERNAL_SERVER_ERROR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user