Skip to content

Web implementation of hashValues can overflow when given too many inputs #50651

Closed
flutter-team-archive/engine
#16624

Description

@jason-simmons

The version of hashValues in lib/web_ui/build/packages/ui/src/ui/hash_codes.dart combines hash values by repeatedly multiplying a running total by a constant and then adding the next value. This can result in overflow if hashValues is given a large number of inputs.

When the underlying JavaScript number overflows it saturates to infinity. This causes hashValues to return the same infinity value for different inputs, resulting in an ineffective hash.

@yjbanov @ferhatb

Activity

  1. added this to the February 2020 milestone on Feb 13, 2020
  2. self-assigned this
    on Feb 13, 2020
  3. github-actions commented on Aug 23, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform-webWeb applications specifically

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions