summaryrefslogtreecommitdiff
path: root/kc
diff options
context:
space:
mode:
authorada christine <45108022+adachristine@users.noreply.github.com>2022-02-10 18:22:28 +0000
committerGitHub <noreply@github.com>2022-02-10 18:22:28 +0000
commitd0b4bb8afc4e135aeb08dcc310631cb95ba96b79 (patch)
tree5b3d2f9862e945a3b9e44105799bbe7175697f1c /kc
parent4d7c0735964918002d09b792f52d326d2dea374e (diff)
missing nul check in type width argument
Diffstat (limited to 'kc')
-rw-r--r--kc/core/kprint.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kc/core/kprint.c b/kc/core/kprint.c
index 18b5af9..70010ea 100644
--- a/kc/core/kprint.c
+++ b/kc/core/kprint.c
@@ -148,7 +148,9 @@ static struct specifier parse_specifier(const char *format, va_list arguments)
// step 3: check for type width arguments
switch (*begin)
- {
+ case 0: // unexpected eos
+ result.type = INVALID_PRINT;
+ return result;
case 'h':
{
if (begin[0] == begin[1])