View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003131 | FSSCP | scripting | public | 2014-11-24 09:14 | 2014-11-24 14:47 |
Reporter | m_m | Assigned To | m_m | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.7.1 | ||||
Target Version | 3.7.2 | ||||
Summary | 0003131: Having an empty action code block in a scripting table causes a crash | ||||
Description | An empty lua action block (see uploaded scripting table) causes a rash while parsing the table. | ||||
Tags | No tags attached. | ||||
|
|
|
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. |
|
3131.patch (524 bytes)
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)); |
|
Fix committed to trunk@11179. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-11-24 09:14 | m_m | New Issue | |
2014-11-24 09:14 | m_m | Status | new => assigned |
2014-11-24 09:14 | m_m | Assigned To | => m_m |
2014-11-24 09:14 | m_m | File Added: require-sct.tbm | |
2014-11-24 09:18 | m_m | Note Added: 0016402 | |
2014-11-24 09:18 | m_m | Status | assigned => code review |
2014-11-24 09:18 | m_m | File Added: 3131.patch | |
2014-11-24 14:47 | Goober5000 | Changeset attached | => fs2open trunk r11179 |
2014-11-24 14:47 | Goober5000 | Note Added: 0016403 | |
2014-11-24 14:47 | Goober5000 | Status | code review => resolved |
2014-11-24 14:47 | Goober5000 | Resolution | open => fixed |