mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-22 21:43:07 +01:00
Formatting
This commit is contained in:
parent
476f7121c3
commit
d346179137
|
|
@ -30,6 +30,7 @@ static int packet_data_remaining = 0;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "mosquitto_broker_internal.h"
|
#include "mosquitto_broker_internal.h"
|
||||||
|
|
||||||
|
|
||||||
ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
||||||
{
|
{
|
||||||
int res = count < packet_data_remaining?count:packet_data_remaining;
|
int res = count < packet_data_remaining?count:packet_data_remaining;
|
||||||
|
|
@ -38,6 +39,7 @@ ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int net__socket_get_address(mosq_sock_t sock, char *buf, size_t len, uint16_t *remote_port)
|
int net__socket_get_address(mosq_sock_t sock, char *buf, size_t len, uint16_t *remote_port)
|
||||||
{
|
{
|
||||||
snprintf(buf, len, "localhost");
|
snprintf(buf, len, "localhost");
|
||||||
|
|
@ -45,6 +47,7 @@ int net__socket_get_address(mosq_sock_t sock, char *buf, size_t len, uint16_t *r
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int http__context_init(struct mosquitto *context)
|
int http__context_init(struct mosquitto *context)
|
||||||
{
|
{
|
||||||
context->transport = mosq_t_http;
|
context->transport = mosq_t_http;
|
||||||
|
|
@ -52,6 +55,7 @@ int http__context_init(struct mosquitto *context)
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt, ...)
|
int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
|
|
@ -62,8 +66,8 @@ int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt,
|
||||||
|
|
||||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||||
{
|
{
|
||||||
struct mosquitto context{};
|
struct mosquitto context {};
|
||||||
struct mosquitto__listener listener{};
|
struct mosquitto__listener listener {};
|
||||||
|
|
||||||
packet_data = data;
|
packet_data = data;
|
||||||
packet_data_pos = 0;
|
packet_data_pos = 0;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ static int packet_data_remaining = 0;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "mosquitto_broker_internal.h"
|
#include "mosquitto_broker_internal.h"
|
||||||
|
|
||||||
|
|
||||||
ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
||||||
{
|
{
|
||||||
int res = count < packet_data_remaining?count:packet_data_remaining;
|
int res = count < packet_data_remaining?count:packet_data_remaining;
|
||||||
|
|
@ -38,6 +39,7 @@ ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int http__context_init(struct mosquitto *context)
|
int http__context_init(struct mosquitto *context)
|
||||||
{
|
{
|
||||||
context->transport = mosq_t_http;
|
context->transport = mosq_t_http;
|
||||||
|
|
@ -45,6 +47,7 @@ int http__context_init(struct mosquitto *context)
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt, ...)
|
int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
|
|
@ -55,8 +58,8 @@ int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt,
|
||||||
|
|
||||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||||
{
|
{
|
||||||
struct mosquitto context{};
|
struct mosquitto context {};
|
||||||
struct mosquitto__listener listener{};
|
struct mosquitto__listener listener {};
|
||||||
|
|
||||||
packet_data = data;
|
packet_data = data;
|
||||||
packet_data_pos = 0;
|
packet_data_pos = 0;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ DEFINE_PROTO_FUZZER(const fuzz_topic_matches_sub::FuzzerInput& fuzzer_input)
|
||||||
clientid = fuzzer_input.clientid().c_str();
|
clientid = fuzzer_input.clientid().c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
//targeted_function_1(fuzzer_input.arg1(), fuzzer_input.arg2(), fuzzer_input.arg3());
|
//targeted_function_1(fuzzer_input.arg1(), fuzzer_input.arg2(), fuzzer_input.arg3());
|
||||||
mosquitto_topic_matches_sub(string1, string2, &result);
|
mosquitto_topic_matches_sub(string1, string2, &result);
|
||||||
mosquitto_topic_matches_sub2(string1, strlen(string1), string2, strlen(string2), &result);
|
mosquitto_topic_matches_sub2(string1, strlen(string1), string2, strlen(string2), &result);
|
||||||
mosquitto_topic_matches_sub_with_pattern(string1, string2, clientid, username, &result);
|
mosquitto_topic_matches_sub_with_pattern(string1, string2, clientid, username, &result);
|
||||||
|
|
|
||||||
|
|
@ -395,6 +395,8 @@ static int read_header(struct mosquitto *mosq, ssize_t (*func_read)(struct mosqu
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_BROKER
|
#ifdef WITH_BROKER
|
||||||
|
|
||||||
|
|
||||||
static int packet__check_in_packet_oversize(struct mosquitto *mosq)
|
static int packet__check_in_packet_oversize(struct mosquitto *mosq)
|
||||||
{
|
{
|
||||||
switch(mosq->in_packet.command & 0xF0){
|
switch(mosq->in_packet.command & 0xF0){
|
||||||
|
|
|
||||||
|
|
@ -956,7 +956,7 @@ void service_uninstall(char *name);
|
||||||
void service_run(char *name);
|
void service_run(char *name);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
DWORD WINAPI SigThreadProc(void* data);
|
DWORD WINAPI SigThreadProc(void *data);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,13 @@
|
||||||
#include "mosquitto/mqtt_protocol.h"
|
#include "mosquitto/mqtt_protocol.h"
|
||||||
#include "property_common.h"
|
#include "property_common.h"
|
||||||
|
|
||||||
|
|
||||||
//int mosquitto_base64_encode(const unsigned char *in, size_t in_len, char **encoded);
|
//int mosquitto_base64_encode(const unsigned char *in, size_t in_len, char **encoded);
|
||||||
|
|
||||||
|
|
||||||
//int mosquitto_base64_decode(const char *in, unsigned char **decoded, unsigned int *decoded_len);
|
//int mosquitto_base64_decode(const char *in, unsigned char **decoded, unsigned int *decoded_len);
|
||||||
|
|
||||||
|
|
||||||
static void check_encode(const char *input, size_t in_len, const char *expected_output)
|
static void check_encode(const char *input, size_t in_len, const char *expected_output)
|
||||||
{
|
{
|
||||||
char *encoded;
|
char *encoded;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue