Open 161250029 opened 4 years ago
I wonder whether my way to slice is incorrect or the result is exactly like this.
Can u give me some advice if convenient.
From your expected result, it seems you want to do a forward slice from your seed statement, to see what else depends on it. Did you try that?
I tried it just now. The final slice result only contains the statement ‘ResultSet resultSet = null;’. This is the slice result I get:
NORMAL bad:11 = invokestatic < Application, Ljava/sql/DriverManager, getConnection(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/Connection; > 8,9,7 @31 exception:10 Node: < Application, Ltestcases/CWE259_Hard_Coded_Password/CWE259_Hard_Coded_Password__driverManager_05, bad()V > Context: Everywhere
I map the statement location to the source code line number according to the slice result and then get the statement ‘ResultSet resultSet = null;’.
@161250029 my guess is that your pointer analysis is very incomplete. In particular, if the points-to set for connection
is empty, you might see issues like this. This will depend on whether WALA sees any call targets for DriverManager.getConnection
. Maybe you can check the call graph.
Thank u for your advice.Since the generation of callgraph depends on entrypointer, I understand you mean that I need to make entrypointer more complete. If what I understand is correct, can you give me an example to make entrypointer more complete.
I would first check the call graph and confirm it’s an issue. Did you do that? Here is some documentation on entry points:
https://github.com/wala/WALA/wiki/Pointer-Analysis#entry-points
The following source code is testing code.
I want to do slicer for the source code 'connection = DriverManager.getConnection("data-url", "root", data);' After getting the seed stament ,I try backwardSlice to do slice. However , the slicer result has only seed statement itself. I expect the slice result like
So how can I get a more pretty result?