Differences From Artifact [73419ef6a6]:
- File src/OFURL.m — part of check-in [dcc3e6aab3] at 2021-10-15 15:59:55 on branch trunk — Work around buggy string overflow checker in GCC (user: js, size: 26377) [annotate] [blame] [check-ins using] [more...]
To Artifact [54ccbf7591]:
- File
src/OFURL.m
— part of check-in
[1483709ab2]
at
2022-08-01 21:20:54
on branch trunk
— Add support for embedding files into binaries
Embedded files are available via the objfw-embedded: URL scheme. (user: js, size: 26582) [annotate] [blame] [check-ins using] [more...]
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008-2022 Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
553 554 555 556 557 558 559 | portString = [OFString stringWithUTF8String: tmp2]; if (portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; _port = [[OFNumber alloc] initWithUnsignedShort: portString.unsignedLongLongValue]; | | > > > > > | > | 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | portString = [OFString stringWithUTF8String: tmp2]; if (portString.unsignedLongLongValue > 65535) @throw [OFInvalidFormatException exception]; _port = [[OFNumber alloc] initWithUnsignedShort: portString.unsignedLongLongValue]; } else { _URLEncodedHost = [[OFString alloc] initWithUTF8String: UTF8String]; if (_URLEncodedHost.length == 0) { [_URLEncodedHost release]; _URLEncodedHost = nil; } } if (_URLEncodedHost != nil && !isIPv6Host) OFURLVerifyIsEscaped(_URLEncodedHost, [OFCharacterSet URLHostAllowedCharacterSet]); if ((UTF8String = tmp) != NULL) { if ((tmp = strchr(UTF8String, '#')) != NULL) { *tmp = '\0'; |
︙ | ︙ | |||
592 593 594 595 596 597 598 | * 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. */ | > | | | | > > | > | 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | * 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. */ #if OF_GCC_VERSION >= 402 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpragmas" # pragma GCC diagnostic ignored "-Wunknown-warning-option" # pragma GCC diagnostic ignored "-Wstringop-overflow" #endif UTF8String--; *UTF8String = '/'; #if OF_GCC_VERSION >= 402 # pragma GCC diagnostic pop #endif _URLEncodedPath = [[OFString alloc] initWithUTF8String: UTF8String]; OFURLVerifyIsEscaped(_URLEncodedPath, [OFCharacterSet URLPathAllowedCharacterSet]); } |
︙ | ︙ |