Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible integer overflow in parse_date_time #2687

Closed
wants to merge 1 commit into from

Commits on Apr 12, 2024

  1. Fix possible integer overflow in parse_date_time

    `g_date_time_to_unix` returns a `gint64`.  Since 27c0728 ("utils:
    replace time_to_string with fmt-based formatting"), `parse_date_time`
    has returned a `time_t`, which has historically been a 32-bit type.
    There is, therefore, the possibility of integer over- and underflow.
    Define `TIME_MIN` and `TIME_MAX` based on the size of `time_t` and clamp
    the return value of `parse_date_time` between these.
    
    Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
    a3a3el committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    e6b4e0e View commit details
    Browse the repository at this point in the history