Overview
Comment: | Work around buggy string overflow checker in GCC |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
dcc3e6aab3716bbd01c7a1a94d8ec278 |
User & Date: | js on 2021-10-15 15:59:55 |
Other Links: | manifest | tags |
Context
2021-10-15
| ||
16:15 | OFUDPSocket: Fix compiling for HP-UX / Wii / 3DS check-in: 50641eb716 user: js tags: trunk | |
15:59 | Work around buggy string overflow checker in GCC check-in: dcc3e6aab3 user: js tags: trunk | |
12:13 | Add GitHub Actions check-in: 6f5189d4f4 user: js tags: trunk | |
Changes
Modified src/OFURL.m from [110acb1505] to [73419ef6a6].
︙ | ︙ | |||
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | initWithUTF8String: tmp + 1]; OFURLVerifyIsEscaped(_URLEncodedQuery, [OFCharacterSet URLQueryAllowedCharacterSet]); } UTF8String--; *UTF8String = '/'; _URLEncodedPath = [[OFString alloc] initWithUTF8String: UTF8String]; OFURLVerifyIsEscaped(_URLEncodedPath, [OFCharacterSet URLPathAllowedCharacterSet]); } | > > > > > > > > > > > > > | 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 | initWithUTF8String: tmp + 1]; OFURLVerifyIsEscaped(_URLEncodedQuery, [OFCharacterSet URLQueryAllowedCharacterSet]); } /* * Some versions of GCC issue a false-positive warning * (turned error) about a string overflow. This is a * false positive because UTF8String is set to tmp * above and tmp is either NULL or points *after* the * slash for the path. So all we do here is go back to * that slash and restore it. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wunknown-warning-option" #pragma GCC diagnostic ignored "-Wstringop-overflow" UTF8String--; *UTF8String = '/'; #pragma GCC diagnostic pop _URLEncodedPath = [[OFString alloc] initWithUTF8String: UTF8String]; OFURLVerifyIsEscaped(_URLEncodedPath, [OFCharacterSet URLPathAllowedCharacterSet]); } |
︙ | ︙ |