Skip to content

Commit

Permalink
Added checks to cross-domain-policy-audit.js to avoid NPE due to resp…
Browse files Browse the repository at this point in the history
…onseChecks being called before there are responses to process.
  • Loading branch information
mckinney-subgraph committed Aug 28, 2013
1 parent e7a2a8a commit 5fa67b9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/scanner/modules/injection/cross-domain-policy-audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ function initialize(ctx) {
}

function process(req, res, ctx) {
ctx.responseChecks(req, res);
if (ctx.hasModuleFailed()) return;

if (res.fetchFail) {
ctx.error(req, res, "During cross-domain policy auditor checks");
ctx.setModuleFailed();
return;
}

if (ctx.allResponsesReceived()) {
ctx.responseChecks(req, res);
}
}


0 comments on commit 5fa67b9

Please sign in to comment.