Page MenuHomeWildfire Games

Check attribute directory path is actually a directory when loading the folder's scripts.
Needs ReviewPublic

Authored by nani on Wed, Oct 9, 5:05 PM.

Details

Reviewers
elexis
Test Plan

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 9788
Build 16463: arc lint + arc unit

Event Timeline

nani created this revision.Wed, Oct 9, 5:05 PM
elexis added a subscriber: elexis.Fri, Oct 11, 7:39 PM
elexis added inline comments.
source/gui/CGUI.cpp
892–899

Could it happen here too that it silently ignores file loading under any circumstance?

908–915

The try/catch block looks like it should be removed, see D2366.

elexis requested changes to this revision.Fri, Oct 11, 9:33 PM
elexis added inline comments.
source/gui/CGUI.cpp
892–899

Something similar can be triggered for this case:

<script file="gui/gamesetup/"/>

vfs_lookup.cpp(141): Assertion failed: "!pathname.IsDirectory()"
Assertion failed: "!pathname.IsDirectory()"
Location: vfs_lookup.cpp:141 (vfs_Lookup)

The rationale is that one can pass any JS and XML to the engine but won't be able to crash it.

908–915

Done in rP23068

This revision now requires changes to proceed.Fri, Oct 11, 9:33 PM
nani updated this revision to Diff 10126.Fri, Oct 11, 10:01 PM
nani updated this revision to Diff 10127.Fri, Oct 11, 10:16 PM

Added check for file attribute.

nani updated this revision to Diff 10129.Fri, Oct 11, 10:38 PM