Don't use isdigit in net/ |
||
Issue descriptionisdigit can return locale-dependent results, which isn't something we should be doing in net. Instead, we should compare directly to numbers, or use net/parse_number.h. It looks like there are 5 consumers: 1) mock_http_cache.cc - test file, doesn't really matter much, unless a developer has issues with it. 2) FtpNetworkTransaction - should be fixed. 3) quick_spdy_stream - status line validator, should use parse_number routines, since it also parses the number. 4) http_status_line_validator - used for histograms. We should decide if we can be more strict about parsing status lines, and just remove the code. 5) spdt_alt_svc_wire_format - this is a roll-your-own ASCII number parser. It should be using parse_number. It's used base::StringPiece::iterators, though, which is a bit weird. Unclear if there's a sane way to get a StringPiece out of that (StringPiece::iterators are just pointers to characters in order, but can we depend on that? Seems icky).
,
Dec 7 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0f8ee2261a801a18d55cab7f28d5551ca23ed012 commit 0f8ee2261a801a18d55cab7f28d5551ca23ed012 Author: mmenke <mmenke@chromium.org> Date: Wed Dec 07 20:15:34 2016 Remove some uses of isdigit in net/, as it can be locale depedent. BUG= 671813 Review-Url: https://codereview.chromium.org/2558643002 Cr-Commit-Position: refs/heads/master@{#437045} [modify] https://crrev.com/0f8ee2261a801a18d55cab7f28d5551ca23ed012/net/ftp/ftp_network_transaction.cc [modify] https://crrev.com/0f8ee2261a801a18d55cab7f28d5551ca23ed012/net/quic/core/quic_spdy_stream.cc [modify] https://crrev.com/0f8ee2261a801a18d55cab7f28d5551ca23ed012/net/quic/core/quic_spdy_stream_test.cc [modify] https://crrev.com/0f8ee2261a801a18d55cab7f28d5551ca23ed012/net/spdy/spdy_alt_svc_wire_format.cc
,
Dec 7 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by mmenke@chromium.org
, Dec 6 2016