Skip to content

Commit 5f12bff

Browse files
committed
FIX: fixed sorting using status and length
1 parent 2d6f174 commit 5f12bff

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/hvqzao/flow/FlowExtension.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@
7272

7373
public class FlowExtension implements IBurpExtender, ITab, IHttpListener, IScopeChangeListener, IExtensionStateListener {
7474

75-
private final String version = "Flow v1.18 (2017-10-14)";
75+
private final String version = "Flow v1.18 (2017-10-15)";
7676
// Changes in v1.18:
7777
// - added Target tool filter and capture source
7878
// - added active / passive scans to context menu
79+
// - FIX: fixed sorting using status and length
7980
//private final String versionFull = "<html>" + version + ", <a href=\"https://github.com/hvqzao/burp-flow\">https://github.com/hvqzao/burp-flow</a>, MIT license</html>";
8081
private static IBurpExtenderCallbacks callbacks;
8182
private static IExtensionHelpers helpers;
@@ -737,8 +738,13 @@ public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequ
737738
// both complete and incomplete requests
738739
if (mode == 1) {
739740
int row = flow.size();
740-
flow.add(new FlowEntry(toolFlag, messageInfo));
741-
flowTableModel.fireTableRowsInserted(row, row);
741+
try {
742+
flow.add(new FlowEntry(toolFlag, messageInfo));
743+
flowTableModel.fireTableRowsInserted(row, row);
744+
} catch (Exception ex) {
745+
// do nothing
746+
//ex.printStackTrace(stderr);
747+
}
742748
triggerAutoDelete();
743749
}
744750
//stdout.println("[+] " + String.valueOf(helpers.analyzeRequest(messageInfo.getHttpService(), messageInfo.getRequest()).getUrl()));
@@ -1843,17 +1849,9 @@ public Object getValueAt(int rowIndex, int columnIndex) {
18431849
case 7:
18441850
return flowEntry.paramCount;
18451851
case 8:
1846-
if (flowEntry.status != -1) {
1847-
return flowEntry.status;
1848-
} else {
1849-
return "";
1850-
}
1852+
return flowEntry.status;
18511853
case 9:
1852-
if (flowEntry.length != -1) {
1853-
return flowEntry.length;
1854-
} else {
1855-
return "";
1856-
}
1854+
return flowEntry.length;
18571855
case 10:
18581856
return flowEntry.mime;
18591857
case 11:
@@ -1913,8 +1911,8 @@ public static final class FlowEntry {
19131911
private final String method;
19141912
private final URL url;
19151913
private final boolean hasParams;
1916-
private short paramCount;
1917-
private Short status;
1914+
private int paramCount;
1915+
private int status;
19181916
private int length;
19191917
private String mime;
19201918
private final Date date;
@@ -2332,6 +2330,9 @@ protected void setValue(Object value) {
23322330
if (value instanceof Date) {
23332331
value = new SimpleDateFormat("HH:mm:ss d MMM yyyy").format(value);
23342332
}
2333+
if ((value instanceof Integer) && ((Integer) value == -1)) {
2334+
value = "";
2335+
}
23352336
super.setValue(value);
23362337
}
23372338

0 commit comments

Comments
 (0)