summaryrefslogtreecommitdiff
path: root/src/common/util.c
AgeCommit message (Collapse)Author
2018-04-23Merge remote-tracking branch 'neel/b25511-r4'Nick Mathewson
2018-04-16Add format_local_iso_time_nospace()Neel Chauhan
2018-04-16Helper function to add u32 without overflow.Mike Perry
2018-04-12Remove windows log_from_handle as unused.Nick Mathewson
This function was only used by PortForwardingHelper, which was removed in 9df110cd72. Its presence caused warnings on windows.
2018-04-04Remove PortForwarding optionsNeel Chauhan
Signed-off-by: Isis Lovecruft <isis@torproject.org>
2018-03-28Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-28Add a paranoia check in string_is_valid_nonrfc_hostname()Nick Mathewson
The earlier checks in this function should ensure that components is always nonempty. But in case somebody messes with them in the future, let's add an extra check to make sure we aren't crashing.
2018-03-28Rename string_is_valid_hostname -> string_is_valid_nonrfc_hostnameNick Mathewson
Per discussion on 25055.
2018-03-28Don't strlen before checking for NULLrl1987
2018-03-28Tweak loop conditionrl1987
2018-03-28Don't explode on NULL or empty stringrl1987
2018-03-28Simplify hostname validation coderl1987
2018-03-28Validate hostnames with punycode TLDs correctlyrl1987
2018-03-28Improve handling of trailing dotrl1987
2018-03-28Refrain from including <ctype.h>rl1987
2018-03-28Call strlen() oncerl1987
2018-03-28Fix bracketed IPv6 string validationrl1987
2018-03-28Do not consider IP strings valid DNS names. Fixes #25055rl1987
2018-03-28Allow IPv6 address strings to be used as hostnames in SOCKS5 requestsrl1987
2018-03-26Merge branch 'bug24658-rm-curve25519-header' into bug24658-mergeNick Mathewson
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-03Include crypto_digest.h in order to solve dependency issues.Fernando Fernandez Mancera
Included crypto_digest.h in some files in order to solve xof+digest module dependency issues. Removed crypto.h where it isn't needed anymore. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2017-12-08Convert the rest of src/common's headers to use FREE_AND_NULLNick Mathewson
2017-10-19Comment-only change: annotate exit() calls.Nick Mathewson
Sometimes when we call exit(), it's because the process is completely hopeless: openssl has a broken AES-CTR implementation, or the clock is in the 1960s, or something like that. But sometimes, we should return cleanly from tor_main() instead, so that embedders can keep embedding us and start another Tor process. I've gone through all the exit() and _exit() calls to annotate them with "exit ok" or "XXXX bad exit" -- the next step will be to fix the bad exit()s. First step towards 23848.
2017-09-28Move around some LCOV_EXCLs in src/commonNick Mathewson
Apparently, my compiler now generates coverage markers for label-only lines, so we need to exclude those too if they are meant to be unreachable.
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15Split some long #if lines to make the #endif annotator happyNick Mathewson
2017-09-15Merge branch 'bug23487_029'Nick Mathewson
2017-09-15Use different variable names for pw_uid usagesNick Mathewson
Catalyst points out that using pw_uid for two different purposes here is likely to be confusing.
2017-09-15Explain the restrictions on divisor in round*_to_next_multiple_ofteor
Closes 23528.
2017-09-12Clear up dead-assignment warnings from scan-buildNick Mathewson
2017-09-12clang scan-build: Fix "dead increment" warnings.Nick Mathewson
For the most part, these indicated a spot where the code could have been better.
2017-09-12Log correctly on owner/user mismatch.Nick Mathewson
Found with clang's scan-build while looking at dead assignments. Fixes bug 23487; bugfix on 1135405c8c6ea31 in 0.2.9.1-alpha
2017-09-06Exit when we can't write to a configured pid fileNick Mathewson
This is probably what the user wants, according to 20119.
2017-08-28Merge branch 'bug22802_squashed'Nick Mathewson
2017-08-28Don't fall back to _atoi64Nick Mathewson
We only did this on windows when building with MSVC 6 and earlier, which is now considered a screamingly bad idea.
2017-08-09Treat a bad tor_spawn_background() as a BUG().Nick Mathewson
The contract is that, if may_spawn_background_process() is 0, you're not even allowed to try to spawn a process.
2017-08-09Add a 'NoExec' option that causes tor_spawn_background() to failNick Mathewson
Core of an implementation for 22976.
2017-07-28Turn base < 0 into a BUG() in our long-parse functions.Nick Mathewson
2017-07-26Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-07-26Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-07-26Suppress clang4-specific -Wdouble-promotion warningsNick Mathewson
Wow, it sure seems like some compilers can't implement isnan() and friends in a way that pleases themselves! Fixes bug 22915. Bug trigged by 0.2.8.1-alpha and later; caused by clang 4.
2017-07-05Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-07-05Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-07-05Only disable -Wfloat-conversion on mingw when it exists.Nick Mathewson
The 22081 fix disabled -Wfloat-conversion, but -Wfloat-conversion didn't exist in every relevant mingw; it was added in GCC 4.9.x some time, if the documentation can be trusted. Bug not in any released version of tor.
2017-07-05Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-07-05Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-07-05Merge branch 'bug22801_028' into maint-0.2.9Nick Mathewson
2017-07-03Fix -Wfloat-conversion C warnings on mingw in clamp_double_to_int64.Nick Mathewson
We just have to suppress these warnings: Mingw's math.h uses gcc's __builtin_choose_expr() facility to declare isnan, isfinite, and signbit. But as implemented in at least some versions of gcc, __builtin_choose_expr() can generate type warnings even from branches that are not taken. Fixes bug 22801; bugfix on 0.2.8.1-alpha.