Bug 23865 - wcsstr is quadratic-time
Summary: wcsstr is quadratic-time
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: string (show other bugs)
Version: 2.28
: P2 normal
Target Milestone: 2.40
Assignee: Adhemerval Zanella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-06 17:41 UTC by Joseph Myers
Modified: 2024-04-11 18:32 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Myers 2018-11-06 17:41:07 UTC
The wcsstr implementation in glibc is a naive O(mn) implementation, which allows denial of service with untrusted inputs.  A smarter O(m+n) implementation should be used, as with strstr.
Comment 1 Florian Weimer 2018-12-15 15:43:55 UTC
Flagging security- until there is demonstrated application impact.
Comment 2 Adhemerval Zanella 2024-04-11 18:32:09 UTC
Fixed on 2.40.