Skip to content

BigInt right-shifting can cause std::vector to throw std::length_error #2672

@guidovranken

Description

@guidovranken
#include <botan/bigint.h>

int main(void)
{
    Botan::BigInt("0") >> (uint32_t)-1;

    return 0;
}
terminate called after throwing an instance of 'std::length_error'
  what():  vector::_M_default_append
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions