summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2021-12-03 11:06:17 -0800
committerGitHub <noreply@github.com>2021-12-03 11:06:17 -0800
commit063c125ad27905a9c00fab897c647c7940cd8f4f (patch)
tree0e154bc2814adac8a0626f8e29dac682bb10c78a
parentd1a1e50f4a53f8faa615dd4adbe34d34297e9a2e (diff)
parentfa3e0023604b4c0f91b46e023d1354b0834a7590 (diff)
downloadcolm-063c125ad27905a9c00fab897c647c7940cd8f4f.tar.gz
Merge pull request #137 from viccie30/memcpy-out-of-bounds
Fix out-of-bounds memcpy
-rw-r--r--src/pdarun.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pdarun.c b/src/pdarun.c
index c958273e..e7f3a7d9 100644
--- a/src/pdarun.c
+++ b/src/pdarun.c
@@ -382,7 +382,8 @@ static void report_parse_error( program_t *prg, tree_t **sp, struct pda_run *pda
/* If there are no error points on record assume the error occurred at the
* beginning of the stream. */
if ( deepest == 0 ) {
- error_head = string_alloc_full( prg, "<input>:1:1: parse error", 32 );
+ const char *parse_error_string = "<input>:1:1: parse error";
+ error_head = string_alloc_full( prg, parse_error_string, strlen( parse_error_string ) );
error_head->location = location_allocate( prg );
error_head->location->line = 1;
error_head->location->column = 1;