aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds-kbdc')
-rw-r--r--src/mds-kbdc/compile-layout.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mds-kbdc/compile-layout.c b/src/mds-kbdc/compile-layout.c
index 0df48eb..c9ff65d 100644
--- a/src/mds-kbdc/compile-layout.c
+++ b/src/mds-kbdc/compile-layout.c
@@ -1087,6 +1087,15 @@ static size_t parse_variable(mds_kbdc_tree_t* restrict tree, const char* restric
var = (size_t)atoll(dotless + 1);
if (strlen(dotless + 1) != (size_t)snprintf(NULL, 0, "%zu", var))
fail_if ((errno = ERANGE));
+ if (var == 0)
+ {
+ NEW_ERROR(tree, INTERNAL_ERROR,
+ "parsed a variable string to be 0, which should not be possible");
+ error->start = lineoff;
+ error->end = lineoff + strlen(raw_);
+ tree->processed = PROCESS_LEVEL;
+ return 1;
+ }
return var;
fail:
return 0;