Commit aef282c2 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

Fix for NULL pointer dereference rendering text areas

The state->column is only defined when there is text to flush, so after lexing pretty much any header item (eg. the version number "! 1") the check for having reached the terminating column results in a NULL pointer dereference.
Tested with *Render TestFiles/TextArea, and a default area header prefixed by !Draw.

Version 1.60. Tagged as 'DrawFile-1_60'
parent a1b5da31
/* (1.59)
/* (1.60)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.59
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 May 2017
#define Module_MajorVersion_CMHG 1.60
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 May 2020
#define Module_MajorVersion "1.59"
#define Module_Version 159
#define Module_MajorVersion "1.60"
#define Module_Version 160
#define Module_MinorVersion ""
#define Module_Date "11 May 2017"
#define Module_Date "13 May 2020"
#define Module_ApplicationDate "11-May-17"
#define Module_ApplicationDate "13-May-20"
#define Module_ComponentName "DrawFile"
#define Module_ComponentPath "castle/RiscOS/Sources/Video/Render/DrawFile"
#define Module_FullVersion "1.59"
#define Module_HelpVersion "1.59 (11 May 2017)"
#define Module_LibraryVersionInfo "1:59"
#define Module_FullVersion "1.60"
#define Module_HelpVersion "1.60 (13 May 2020)"
#define Module_LibraryVersionInfo "1:60"
......@@ -747,7 +747,7 @@ static os_error *Flush(State * state, Flush_Type flush_type)
text = line_start;
}
if (state->column->type != 0)
if (state->column && state->column->type != 0)
{
int left;
......@@ -1211,7 +1211,7 @@ os_error *textarea_render(drawfile_object * object, os_trfm * trfm,
break;
}
if (state.column->type == 0)
if (state.column && state.column->type == 0)
/* No more columns for output. */
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment