Commit graph

3395 commits

Author SHA1 Message Date
Simon Arlott
30275c67c5
charybdis 4-rc5 2017-07-30 18:43:52 +01:00
Aaron Jones
515467e527
mbedtls.c: minor fixups
- Add (void) casts for unused function parameters
- Rearrange member in `struct rb_mbedtls_cfg_context' for data alignment
- Document a `clang-4.0 -Weverything' (-Wcast-qual) diagnostic
- Avoid pointless conversions between positive/negative error codes
- Use capital hexadecimals in error codes and properly cast to
  (unsigned int) for %x/%X
2017-07-30 18:41:32 +01:00
Simon Arlott
3fb264ef49
m_cap: use rn_snprintf_try_append 2017-07-30 18:30:28 +01:00
Simon Arlott
0e6b8d0af9
tests: add rb_snprintf_append, rb_snprintf_try_append tests 2017-07-30 17:05:26 +01:00
Simon Arlott
e5c434a2df
librb: add rb_snprintf_try_append
For when it might fit, or it might not.
2017-07-30 17:04:06 +01:00
Simon Arlott
8573c3409e
librb: rb_snprinf_append: handle error return value from vsnprintf() 2017-07-30 17:03:30 +01:00
Simon Arlott
2cc7be9977
tests: add rb_linebuf_put tests 2017-07-30 15:56:29 +01:00
Simon Arlott
7a06833fb4
librb: linebuf: reduce the number of "put" implementations from 4 to 1 2017-07-30 15:51:45 +01:00
Simon Arlott
a7fed8715b
Revert "Core modules cannot be unloaded, otherwise bad things happen."
This reverts commit b5cfad0319.
2017-07-29 23:52:06 +01:00
Simon Arlott
2f0b6f83bd
m_join: remove global variable parabuf 2017-07-29 23:48:55 +01:00
Simon Arlott
95fff33cf6
m_join: remove global variable modebuf 2017-07-29 23:48:54 +01:00
Simon Arlott
b051b0efd9
m_join: remove global variable para 2017-07-29 23:48:53 +01:00
Simon Arlott
7fce9c6d1b
m_join: remove global variable pargs 2017-07-29 23:48:53 +01:00
Simon Arlott
2077757f2a
m_join: remove global variable mbuf 2017-07-29 23:48:52 +01:00
Simon Arlott
4c7d1de8f3
librb: linebuf needs to use the buffer limit from msgbuf_unparse_prefix 2017-07-29 23:32:27 +01:00
Simon Arlott
5ce6360b72
ircd: send: these buffers can be static 2017-07-29 23:24:23 +01:00
Simon Arlott
b6f271b2aa
m_cap: Fix CAP LS generation
The `caplen` variable was unused, so the cap to be output wasn't considered
when determining whether or not it would fit.
2017-07-29 22:46:11 +01:00
Simon Arlott
2100c58d09
librb: rb_rawbuf_length: do something if soft assert fails
correct the value of rb->len
2017-07-29 22:46:10 +01:00
Simon Arlott
108699df3c
tests: add msgbuf_unparse tests 2017-07-29 22:46:09 +01:00
Simon Arlott
17ea888046
tests: add substitution_parse tests 2017-07-29 22:46:09 +01:00
Simon Arlott
05a16d98e1
tests: add msgbuf_parse tests 2017-07-29 22:46:08 +01:00
Simon Arlott
f3564f47f4
msgbuf: correctly split buffers into IRCv3 tags and RFC1459 message data 2017-07-29 22:46:07 +01:00
Simon Arlott
9f46eae691
linebuf: increase buffer size to accommodate IRCv3 tags 2017-07-29 22:46:06 +01:00
Simon Arlott
8fe5ef5a23
tests: add C TAP harness 2017-07-29 22:46:05 +01:00
Simon Arlott
33ded5fc57
librb: remove unnecessary NULL from the end of rb_string_to_array output 2017-07-29 22:46:04 +01:00
Simon Arlott
86432f8f86
ircd: attach_conf: avoid clang static analysis warning
In the impossible scenario where ClassPtr(aconf) is NULL, reject the
client instead of dereferencing the NULL pointer.
2017-07-29 22:45:58 +01:00
Simon Arlott
b5ad4cdfde
make soft asserts better by allowing them to be used in expressions 2017-07-29 22:39:53 +01:00
Simon Arlott
3ec3b44c7e
wsockd: avoid clang static analysis warning
Don't set `x = 0` twice.
2017-07-29 22:39:53 +01:00
Simon Arlott
26acc0c4fd
authd: opm: avoid clang static analysis warning
Remove unused `c` variable.
2017-07-29 22:39:52 +01:00
Simon Arlott
07807ce8b0
ircd: send_to_channel_flags: avoid clang static analysis warning
Set current_capmask and then use it, instead of referencing target_p->localClient->caps again.

This makes the purpose of current_capmask a bit clearer.
2017-07-29 22:39:50 +01:00
Simon Arlott
d856535edd
ircd: sendto_one_notice: avoid clang static analysis warning
target_p->from can't be NULL, and if it is then get_id(..., target_p)
dereferences it later in the function anyway
2017-07-29 22:39:49 +01:00
Simon Arlott
45285c4a73
librb: rb_lib_loop: avoid clang static analysis warning 2017-07-29 22:39:49 +01:00
Simon Arlott
209c57fbbf
ssld: avoid clang static analysis warning
Don't set `x = 0` twice.
2017-07-29 22:39:48 +01:00
Simon Arlott
0d6da1a9c1
ircd: sendto_one_numeric: avoid clang static analysis warning
target_p->from can't be NULL, and if it is then get_id(..., target_p)
dereferences it later in the function anyway
2017-07-29 22:28:53 +01:00
Simon Arlott
4a9f4dccb8
authd: opm: avoid clang static analysis warning
Remove unused `lookup` variables.
2017-07-29 22:28:52 +01:00
Simon Arlott
b9a6f1e5a1
ircd: get_or_create_channel: avoid clang static analysis warning
Use `len` after setting it.
2017-07-29 22:28:51 +01:00
Simon Arlott
f660af2155
ssld: avoid clang static analysis warning 2017-07-29 22:28:50 +01:00
Simon Arlott
0ded533dbc
ircd: sendto_one_prefix: avoid clang static analysis warning
target_p->from can't be NULL, and if it is then get_id(..., target_p)
dereferences it later in the function anyway
2017-07-29 22:28:49 +01:00
Simon Arlott
6c1e15a432
exit_remote_server: avoid clang static analysis warning
if IsServer(source_p) then the following must be all non-NULL:
 ->serv
 ->servptr
 ->servptr->serv

Remove unnecessary and inconsistent pointer checks.
2017-07-29 22:28:48 +01:00
Simon Arlott
630c15211d
librb: rb_linebuf_copy_raw: remove unused assignment 2017-07-29 22:28:47 +01:00
Simon Arlott
ab5fc9c032
ircd: hostmask: avoid clang static analysis warning
arec->Mask.ipa.bits is unused if arec->masktype == HM_HOST
2017-07-29 22:27:23 +01:00
Simon Arlott
b0adc7bf97
librb: commio: Must set addrlen before every call to accept()
If an IPv4 connection is dropped by the pre-callback, and there is a
pending IPv6 connection on the same listening socket then the retried
accept() will be unable to populate `st` because `addrlen` will be too
small. Also initialise `st` each time to avoid a clang static analysis
warning.
2017-07-29 22:20:05 +01:00
Simon Arlott
8467fd9caf
ircd: listener: Document check_reject() behaviour 2017-07-29 22:20:04 +01:00
Simon Arlott
23e722ea21
wsockd: Initialise ws_frame_hdr_t before using it
Outgoing messages have uninitialised data from the stack in the 3 reserved
bits of the opcode_rsv_fin value.
2017-07-29 22:20:03 +01:00
Simon Arlott
a940f54623
sslproc: check number of arguments to zipstats command 2017-07-29 13:32:21 +01:00
Aaron Jones
ed9f6a6565
src/channel.c: don't use the bancache in is_banned()/is_quieted()
The bancache will be re-architected onto clients in future for easier
invalidation, but this is a good-enough temporary fix for issue #243

Fixes #243
2017-07-29 13:32:20 +01:00
Simon Arlott
be9fb5ac00
Revert "no really, it's dead people"
This reverts commit 40ac82e878.
2017-07-27 18:51:24 +01:00
Simon Arlott
4efe9cf25d
charybdis 4-rc4 2017-07-27 18:47:18 +01:00
Simon Arlott
e9f0d740e3
msgbuf: remove unused field parselen 2017-07-27 18:31:08 +01:00
Simon Arlott
fb81421fc7
ircd: substitution: fix NULL termination buffer overrun when the output is too large for the buffer 2017-07-27 18:31:07 +01:00