View Issue Details

IDProjectCategoryView StatusLast Update
0000833LDMud 3.5LPC Compiler/Preprocessorpublic2018-01-30 04:59
Reporterzesstra Assigned ToGnomi  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSMacOS XOS Version10.9.x
Target Version3.5.0Fixed in Version3.5.0 
Summary0000833: lexer crashes upon specially crafted precompiler directive #if
DescriptionThe following code can crash the driver, if special circumstances are met:
#if \
 __VERSION_MAJOR
int run_test() { return 1; }
#endif

1) The __VERSION_MAJOR does not exist (otherwise the precompiler just behaves wrongly).
2) The line after the #if is at a position in the file that the input buffer of the lexxer is full within that line (so it has to be at multiples of 2048 bytes).

And yes. I caused the crash by accident and did not find it by looking at the lexer...

At test case will be pushed shortly (courtesy of Gnomi).
TagsNo tags attached.

Activities

zesstra

2014-02-25 23:41

administrator   ~0002237

I guess, I found the culprit. skip_to() is called with nothing left in the buffer, but does not check itself if the first character it processes is actually the \0 at the end of the buffer... And then it just reads happily along outside of the buffer.

guest

2015-02-06 15:39

viewer   ~0002246

Fix committed in revision 8aa760447fdb0488f22ccd97ceb2f7b602a8c3f0 to master branch (see changeset 983 for details). Thank you for reporting!

Gnomi

2018-01-29 19:59

manager   ~0002311

Fix committed in revision 8aa760447fdb0488f22ccd97ceb2f7b602a8c3f0 to master branch (see changeset 1410 for details). Thank you for reporting!

Gnomi

2018-01-29 22:57

manager   ~0002362

Fix committed in revision 8aa760447fdb0488f22ccd97ceb2f7b602a8c3f0 to master branch (see changeset 2738 for details). Thank you for reporting!

Gnomi

2018-01-30 04:59

manager   ~0002413

Fix committed in revision 8aa760447fdb0488f22ccd97ceb2f7b602a8c3f0 to master branch (see changeset 3823 for details). Thank you for reporting!

Issue History

Date Modified Username Field Change
2014-02-24 21:33 zesstra New Issue
2014-02-24 21:52 Source_changeset_attached => ldmud.git master 2b8c7a5a
2014-02-25 19:12 zesstra Status new => confirmed
2014-02-25 23:41 zesstra Note Added: 0002237
2014-02-25 23:41 zesstra Assigned To => zesstra
2014-02-25 23:41 zesstra Status confirmed => assigned
2015-02-06 15:39 Source_changeset_attached => ldmud.git master 8aa76044
2015-02-06 15:39 guest Note Added: 0002246
2015-02-06 15:39 guest Status assigned => resolved
2015-02-06 15:39 guest Resolution open => fixed
2017-10-04 20:55 zesstra Fixed in Version => 3.5.0
2018-01-29 19:59 Gnomi Source_changeset_attached => ldmud.git master 8aa76044
2018-01-29 19:59 Gnomi Source_changeset_attached => ldmud.git master 2b8c7a5a
2018-01-29 19:59 Gnomi Note Added: 0002311
2018-01-29 19:59 Gnomi Assigned To zesstra => Gnomi
2018-01-29 22:57 Gnomi Source_changeset_attached => ldmud.git master 8aa76044
2018-01-29 22:57 Gnomi Source_changeset_attached => ldmud.git master 2b8c7a5a
2018-01-29 22:57 Gnomi Note Added: 0002362
2018-01-30 04:59 Gnomi Source_changeset_attached => ldmud.git master 8aa76044
2018-01-30 04:59 Gnomi Source_changeset_attached => ldmud.git master 2b8c7a5a
2018-01-30 04:59 Gnomi Note Added: 0002413