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

susceptible to y2038 (inextricable from format) #37

Open
nabijaczleweli opened this issue Jan 25, 2025 · 0 comments · May be fixed by #38
Open

susceptible to y2038 (inextricable from format) #37

nabijaczleweli opened this issue Jan 25, 2025 · 0 comments · May be fixed by #38

Comments

@nabijaczleweli
Copy link

Downstream bug: https://bugs.debian.org/1094187

int read_header(FILE *fp, Header *h)
{
    uint32_t buf[3];

    if (fread_wrapper(buf, sizeof(uint32_t), 3, fp) == 0)
    {
        return 0;
    }

    h->tv.tv_sec  = convert_to_little_endian(buf[0]);
    h->tv.tv_usec = convert_to_little_endian(buf[1]);
    h->len        = convert_to_little_endian(buf[2]);

    return 1;
}

This means the format is inherently susceptible to y2038.

Given that this format is produced and consumed by multiple implementations, some sort of Reasonably Coordinated Implementation needs to be invented here.

nabijaczleweli added a commit to nabijaczleweli/ovh-ttyrec that referenced this issue Jan 25, 2025
nabijaczleweli added a commit to nabijaczleweli/ovh-ttyrec that referenced this issue Jan 25, 2025
nabijaczleweli added a commit to nabijaczleweli/ovh-ttyrec that referenced this issue Jan 25, 2025
nabijaczleweli added a commit to nabijaczleweli/ovh-ttyrec that referenced this issue Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant