1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41:29 +00:00

Correct a bug in the code for NmapOutputViewer.go_to_host that was put in revision 32936.

The following steps caused the bug with the r32936 code:
    1. Start a scan (say Quick Scan for simplicity) for a certain target (say A)
    2. Wait for scan to complete
    3. Start a scan for a different target (say B).
    4. Wait for scan to complete
    5. Click on host A in the Hosts list on the left (while scan B is still visible on the right)
    6. BOOM!
This commit is contained in:
jay
2014-06-04 11:41:29 +00:00
parent f51de3bc0e
commit 381bf2fd23

View File

@@ -218,9 +218,13 @@ class NmapOutputViewer (gtk.VBox):
buff = self.text_view.get_buffer()
start_iter = buff.get_start_iter()
found = start_iter.forward_search(
found_tuple = start_iter.forward_search(
"\nNmap scan report for %s\n" % host, gtk.TEXT_SEARCH_TEXT_ONLY
)[0]
)
if found_tuple is None:
return
found = found_tuple[0]
if not found.forward_line():
return
self.text_view.scroll_to_iter(found, 0, True, 0, 0)