Skip to content

Commit

Permalink
fix potential datetime overflow bug
Browse files Browse the repository at this point in the history
Signed-off-by: Aakash Arayambeth <aarayambeth@bloomberg.net>
  • Loading branch information
Aakash Arayambeth authored and aakash10292 committed Oct 13, 2023
1 parent 2783b19 commit 210f609
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datetime/localtimedb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2200,6 +2200,12 @@ static struct db_state *find_tz(const char *name)
char key[NAME_KEY_MAX];
tz_hash_entry_type *ptr;

if (strlen(name) > NAME_KEY_MAX) {
logmsg(LOGMSG_ERROR, "%s: key name too long. max: %d\n",
__func__, NAME_KEY_MAX);
return NULL;
}

bzero(key, NAME_KEY_MAX);
strcpy(key, name);

Expand Down

0 comments on commit 210f609

Please sign in to comment.