Skip to content

Commit

Permalink
Zero length files (#203)
Browse files Browse the repository at this point in the history
* Better handling for project default name when source path is current or .\

* Fix for #179 to add check for existing log config

* Fix #200

* Check for zero length files to scan which can cause exceptions on archive type check.
  • Loading branch information
guyacosta authored May 7, 2020
1 parent 4ab3098 commit 6a6da3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions AppInspector/Commands/AnalyzeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ public AnalyzeResult GetResult()
// Iterate through all files and process against rules
foreach (string filename in _srcfileList)
{
if (new FileInfo(filename).Length == 0)
{
WriteOnce.SafeLog(MsgHelp.FormatString(MsgHelp.ID.ANALYZE_EXCLUDED_TYPE_SKIPPED, filename), LogLevel.Warn);
_metaDataHelper.Metadata.FilesSkipped++;
continue;
}

ArchiveFileType archiveFileType = ArchiveFileType.UNKNOWN;
try //fix for #146
{
Expand Down
6 changes: 3 additions & 3 deletions AppInspector/Resources/defaultRulesPkd.json
Original file line number Diff line number Diff line change
Expand Up @@ -11156,7 +11156,7 @@
"overrides": null,
"patterns": [
{
"pattern": "\\b(WindowsImpersonationContext|WindowsIdentity\\.Impersonate|WindowsIdentity\\.RunImpersonated||ImpersonateIdentity)\\b",
"pattern": "\\b(WindowsImpersonationContext|WindowsIdentity\\.Impersonate|WindowsIdentity\\.RunImpersonated|ImpersonateIdentity)\\b",
"type": "regex",
"modifiers": null,
"scopes": [
Expand Down Expand Up @@ -14003,9 +14003,9 @@
"conditions": []
},
{
"name": "Testing Framework: ",
"name": "Testing Framework: JSUnit",
"id": "AI042000",
"description": "Testing Framework: ",
"description": "Testing Framework: JSUnit",
"applies_to": [
"javascript"
],
Expand Down

0 comments on commit 6a6da3b

Please sign in to comment.