All checks were successful
CI Code / Check spelling (pull_request) Successful in 14s
CI Code / Check coding style (pull_request) Successful in 26s
CI Code / Code Coverage (pull_request) Successful in 3m29s
CI Code / Linux (debian) (pull_request) Successful in 5m13s
CI Code / Linux (ubuntu) (pull_request) Successful in 5m16s
CI Code / Linux (arch) (pull_request) Successful in 7m34s
T02: guard the receive-path handlers that dereferenced jid_create() without a NULL check — MUC join errors, subscribed/unsubscribed presence and, with silence.non-roster enabled, every incoming message. A stanza with a missing or malformed 'from' crashed the client (REQ-INP-01) T11: restrict /url open and /url save to http, https and aesgcm, so a received file:, javascript: or data: URL is refused (REQ-INP-06); spawn terminal-notifier through g_spawn_async with an argv instead of building a shell command for system() (REQ-INP-07); apply the XEP-0359 disco gate to MAM result ids, as live stanza-ids already do (REQ-INP-05); replace control and bidi-reordering characters in incoming message bodies with U+FFFD before they reach the terminal, the logs and the database, keeping LRM/RLM for legitimate RTL text (REQ-INP-08); cover JID part-length boundaries and invalid UTF-8 (REQ-INP-02) T10: replace strcpy/strcat/alloca and sprintf with g_strdup_printf and g_snprintf (REQ-MEM-03); allocate the OMEMO key buffers with g_malloc so a failed allocation cannot reach the following memcpy (REQ-MEM-04); remove the variable-length arrays and enforce -Werror=vla. Two of them were sized from remote input: the disco#info feature count and a chat message word length. The flag also caught a one-past-the-end write and a leak in the plugin autocompleter bindings (REQ-MEM-09)
74 lines
3.7 KiB
C
74 lines
3.7 KiB
C
/*
|
|
* test_common.h
|
|
*
|
|
* Copyright (C) 2015 - 2016 James Booth <boothj5@gmail.com>
|
|
* Copyright (C) 2018 - 2026 Michael Vetter <jubalh@iodoru.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
#ifndef TESTS_TEST_COMMON_H
|
|
#define TESTS_TEST_COMMON_H
|
|
|
|
void str_replace__returns__one_substr(void** state);
|
|
void str_replace__returns__one_substr_beginning(void** state);
|
|
void str_replace__returns__one_substr_end(void** state);
|
|
void str_replace__returns__two_substr(void** state);
|
|
void str_replace__returns__char(void** state);
|
|
void str_replace__returns__original_when_none(void** state);
|
|
void str_replace__returns__replaced_when_match(void** state);
|
|
void str_replace__returns__empty_when_string_empty(void** state);
|
|
void str_replace__returns__null_when_string_null(void** state);
|
|
void str_replace__returns__original_when_sub_empty(void** state);
|
|
void str_replace__returns__original_when_sub_null(void** state);
|
|
void str_replace__returns__empty_when_new_empty(void** state);
|
|
void str_replace__returns__original_when_new_null(void** state);
|
|
|
|
void valid_resource_presence_string__is__true_for_online(void** state);
|
|
void valid_resource_presence_string__is__true_for_chat(void** state);
|
|
void valid_resource_presence_string__is__true_for_away(void** state);
|
|
void valid_resource_presence_string__is__true_for_xa(void** state);
|
|
void valid_resource_presence_string__is__true_for_dnd(void** state);
|
|
void valid_resource_presence_string__is__false_for_available(void** state);
|
|
void valid_resource_presence_string__is__false_for_unavailable(void** state);
|
|
void valid_resource_presence_string__is__false_for_blah(void** state);
|
|
|
|
void utf8_display_len__returns__0_for_null(void** state);
|
|
void utf8_display_len__returns__1_for_non_wide(void** state);
|
|
void utf8_display_len__returns__2_for_wide(void** state);
|
|
void utf8_display_len__returns__correct_for_non_wide(void** state);
|
|
void utf8_display_len__returns__correct_for_wide(void** state);
|
|
void utf8_display_len__returns__correct_for_all_wide(void** state);
|
|
|
|
void strip_arg_quotes__returns__original_when_no_quotes(void** state);
|
|
void strip_arg_quotes__returns__stripped_first(void** state);
|
|
void strip_arg_quotes__returns__stripped_last(void** state);
|
|
void strip_arg_quotes__returns__stripped_both(void** state);
|
|
void strip_arg_quotes__unescapes(void** state);
|
|
|
|
void prof_occurrences__tests__partial(void** state);
|
|
void prof_occurrences__tests__whole(void** state);
|
|
void prof_occurrences__tests__large_message(void** state);
|
|
void unique_filename_from_url__tests__table_driven(void** state);
|
|
void format_call_external_argv__tests__table_driven(void** state);
|
|
void get_expanded_path__returns__expanded(void** state);
|
|
void string_to_verbosity__returns__correct_values(void** state);
|
|
void strtoi_range__returns__true_for_valid_input(void** state);
|
|
void strtoi_range__returns__false_for_out_of_range(void** state);
|
|
void strtoi_range__returns__false_for_invalid_input(void** state);
|
|
void strtoi_range__returns__false_for_null_empty_input(void** state);
|
|
void strtoi_range__returns__correct_values_when_err_msg_null(void** state);
|
|
void strtoi_range__returns__false_for_integer_overflow_underflow(void** state);
|
|
void strtoi_range__returns_consistent_with_strtol_parsing(void** state);
|
|
void string_matches_one_of__tests__edge_cases(void** state);
|
|
void valid_tls_policy_option__is__correct_for_various_inputs(void** state);
|
|
void get_mentions__tests__various(void** state);
|
|
void release_is_new__tests__various(void** state);
|
|
void str_xml_sanitize__strips_illegal_characters(void** state);
|
|
|
|
#endif
|
|
void neutralize_untrusted_keeps_plain_text(void** state);
|
|
void neutralize_untrusted_replaces_escape_sequence(void** state);
|
|
void neutralize_untrusted_replaces_bidi_override(void** state);
|
|
void neutralize_untrusted_keeps_rtl_marks(void** state);
|
|
void neutralize_untrusted_handles_null(void** state);
|