2018-05-27 12:28 EDT


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0003131FSSCPscriptingpublic2014-11-24 09:47
Reporterm_m 
Assigned Tom_m 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
Product Version3.7.1 
Target Version3.7.2Fixed in Version 
Summary0003131: Having an empty action code block in a scripting table causes a crash
DescriptionAn empty lua action block (see uploaded scripting table) causes a rash while parsing the table.
TagsNo tags attached.
Attached Files
  • ? file icon require-sct.tbm (82 bytes) 2014-11-24 04:14
  • patch file icon 3131.patch (524 bytes) 2014-11-24 04:18 -
    Index: code/parse/parselo.cpp
    ===================================================================
    --- code/parse/parselo.cpp	(revision 11178)
    +++ code/parse/parselo.cpp	(working copy)
    @@ -1096,11 +1096,6 @@
     		//Set final length for faster calcs
     		flen = pos-Mp;
     
    -		// if we don't have anything to read then bail
    -		if (flen <= 0) {
    -			return NULL;
    -		}
    -
     		//Allocate the memory
     		//WMC - Don't forget the null character that's added later on.
     		rval = (char*) vm_malloc((flen + extra_chars + 1)*sizeof(char));
    
    patch file icon 3131.patch (524 bytes) 2014-11-24 04:18 +

-Relationships
+Relationships

-Notes

~0016402

m_m (developer)

alloc_block returns a NULL pointer when the parsed block is empty. That value should only be returned when a serious error was detected (in this case vm_malloc failed to allocate memory).
The uploaded patch fixes this behavior by removing that condition.

~0016403

Goober5000 (administrator)

Fix committed to trunk@11179.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2014-11-24 04:14 m_m New Issue
2014-11-24 04:14 m_m Status new => assigned
2014-11-24 04:14 m_m Assigned To => m_m
2014-11-24 04:14 m_m File Added: require-sct.tbm
2014-11-24 04:18 m_m Note Added: 0016402
2014-11-24 04:18 m_m Status assigned => code review
2014-11-24 04:18 m_m File Added: 3131.patch
2014-11-24 09:47 Goober5000 Changeset attached => fs2open trunk r11179
2014-11-24 09:47 Goober5000 Note Added: 0016403
2014-11-24 09:47 Goober5000 Status code review => resolved
2014-11-24 09:47 Goober5000 Resolution open => fixed
+Issue History