mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Fixed a segfault in printportoutput() and setServiceXMLBuf() in output.cc.
Thanks for pointing this out Brandon.
This commit is contained in:
parent
38c50f3ac3
commit
f0cbbe45f8
1 changed files with 2 additions and 2 deletions
|
|
@ -210,7 +210,7 @@ static int getServiceXMLBuf(struct serviceDeductions *sd, char *&xmlbuf) {
|
|||
char *xml_servicefp = NULL, *xml_servicefp_temp = NULL;
|
||||
int xmlbuflen=0;
|
||||
|
||||
if (!sd->name && !sd->service_fp) return 0;
|
||||
if (!sd->name && !sd->service_fp) return -1;
|
||||
|
||||
if (sd->product) {
|
||||
xml_product = xml_convert(sd->product);
|
||||
|
|
@ -765,7 +765,7 @@ void printportoutput(Target *currenths, PortList *plist) {
|
|||
log_write(LOG_XML, "<owner name=\"%s\" />", current->owner);
|
||||
}
|
||||
if (getServiceXMLBuf(&sd, xmlbuf) == 0)
|
||||
if (*xmlbuf){
|
||||
if (xmlbuf){
|
||||
log_write(LOG_XML, "%s", xmlbuf);
|
||||
free(xmlbuf);
|
||||
xmlbuf=NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue