Skip to content

Tidy 5.7.20 GetSurrogatePair can use uninitialised value processing malformed entity refs #798

Description

@dd8

GetSurrogatePair ignores scanf return value, which means ch may be uninitialised if buf doesn't contain hex or digits (or uses # incorrectly) leading to UTF encoding errors and undefined behaviour.

Here's a patch for the issue
patch-scanf.diff.txt

Compiles in XCode 10 clang on Mac, Visual Studio 2015 on Windows
Tested in production on macOS 10.13, macOS 10.14, Windows 7, Windows 10, Windows Server 2016

Not tested on Linux/gcc

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions