diff options
| author | ada christine <45108022+adachristine@users.noreply.github.com> | 2022-02-10 18:22:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-10 18:22:28 +0000 |
| commit | d0b4bb8afc4e135aeb08dcc310631cb95ba96b79 (patch) | |
| tree | 5b3d2f9862e945a3b9e44105799bbe7175697f1c /kc | |
| parent | 4d7c0735964918002d09b792f52d326d2dea374e (diff) | |
missing nul check in type width argument
Diffstat (limited to 'kc')
| -rw-r--r-- | kc/core/kprint.c | 4 |
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]) |
