diff options
author | Cem Keylan <cem@ckyln.com> | 2021-03-09 08:42:47 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2021-03-09 08:42:47 +0300 |
commit | 2106f384939b9627996a77dca7d4310c91f482d7 (patch) | |
tree | cf459a74499ea86f2c138b99487a97bb2860a829 /networking | |
parent | 09f572b1e859bfb103f654ac86541710d964d9aa (diff) | |
parent | 89358a7131d3e75c74af834bb117b4fad7914983 (diff) | |
download | busybox-1_33_stable.tar.gz |
Merge remote-tracking branch 'upstream/1_33_stable' into 1_33_stable1_33_stable
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 6 | ||||
-rw-r--r-- | networking/traceroute.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 4346141ee..4c014bc71 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -1871,7 +1871,7 @@ static NOINLINE void send_file_and_exit(const char *url, int what) send_headers(HTTP_OK); #if ENABLE_FEATURE_USE_SENDFILE { - off_t offset = range_start; + off_t offset = (range_start < 0) ? 0 : range_start; while (1) { /* sz is rounded down to 64k */ ssize_t sz = MAXINT(ssize_t) - 0xffff; @@ -2486,8 +2486,8 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr) if (STRNCASECMP(iobuf, "Range:") == 0) { /* We know only bytes=NNN-[MMM] */ char *s = skip_whitespace(iobuf + sizeof("Range:")-1); - if (is_prefixed_with(s, "bytes=")) { - s += sizeof("bytes=")-1; + s = is_prefixed_with(s, "bytes="); + if (s) { range_start = BB_STRTOOFF(s, &s, 10); if (s[0] != '-' || range_start < 0) { range_start = -1; diff --git a/networking/traceroute.c b/networking/traceroute.c index 3f1a9ab46..29f5e480b 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -896,7 +896,7 @@ traceroute_init(int op, char **argv) op |= getopt32(argv, "^" OPT_STRING - "\0" "-1:x-x" /* minimum 1 arg */ + "\0" "-1" /* minimum 1 arg */ , &tos_str, &device, &max_ttl_str, &port_str, &nprobes_str , &source, &waittime_str, &pausemsecs_str, &first_ttl_str ); |