Squashed commit of the following:

commit 7ba68dd20d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Wed Nov 16 16:19:50 2022 +0100

    Proper C/C++ struct initialization.

commit aeab3ef7ac
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 17:09:29 2022 +0100

    Fixed C++ builds.

commit 2afd529107
Merge: 14710b81 f8445a4c
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Tue Nov 15 11:33:56 2022 +0100

    Merge branch 'cesanta:master' into master

commit 14710b81e4
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:07:15 2022 +0100

    Added MIP free.

commit 6393cd149d
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:06:44 2022 +0100

    Adding mip_free() function.

commit feee81b733
Author: Jean-Francois Simon <jfsimon@startmail.com>
Date:   Tue Nov 15 11:05:55 2022 +0100

    Adding mip_free() function.

commit f8445a4c85
Merge: a39b7ddb 71f5be01
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:42:38 2022 -0300

    Merge pull request #1853 from cesanta/tibaremetaltest

    Update test.yml

commit 71f5be011b
Author: Sergio R. Caprile <scaprile@users.noreply.github.com>
Date:   Fri Nov 11 20:15:01 2022 -0300

    Update test.yml

commit b53d3cf032
Merge: 7a71038a a39b7ddb
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:10:53 2022 +0100

    Merge branch 'cesanta:master' into master

commit 7a71038a27
Author: jfsimon1981 <jfsimon1981@gmail.com>
Date:   Fri Nov 11 16:09:22 2022 +0100

    Update mip_test.c

commit a39b7ddbac
Author: cpq <valenok@gmail.com>
Date:   Fri Nov 11 15:03:48 2022 +0000

    Fix fuzzer use-after-poison READ 1
This commit is contained in:
Jean-Francois Simon committed 2022-11-16 17:43:33 +01:00
1 parent cab5c822c5
commit 7b0509c878
7 files changed
+216 -5

No files matched your search

+7 -2
View File
@@ -3196,7 +3196,7 @@ int mg_mqtt_parse(const uint8_t *buf, size_t len, uint8_t version,
p += 2;
}
if (p > end) return MQTT_MALFORMED;
if (version == 5 && p + 1 < end) p += 1 + p[0]; // Skip options
if (version == 5 && p + 2 < end) p += 1 + p[0]; // Skip options
if (p > end) return MQTT_MALFORMED;
m->data.ptr = (char *) p;
m->data.len = (size_t) (end - p);
@@ -7007,7 +7007,7 @@ static size_t tx_tcp(struct mip_if *ifp, uint32_t dst_ip, uint8_t flags,
struct ip *ip = tx_ip(ifp, 6, ifp->ip, dst_ip, sizeof(struct tcp) + len);
struct tcp *tcp = (struct tcp *) (ip + 1);
memset(tcp, 0, sizeof(*tcp));
memmove(tcp + 1, buf, len);
if (buf != NULL && len) memmove(tcp + 1, buf, len);
tcp->sport = sport;
tcp->dport = dport;
tcp->seq = seq;
@@ -7374,6 +7374,11 @@ void mip_init(struct mg_mgr *mgr, struct mip_if *ifp) {
}
}
void mip_free(struct mip_if * ifp) {
free((char *)ifp->rx.ptr);
free((char *)ifp->tx.ptr);
}
int mg_mkpipe(struct mg_mgr *m, mg_event_handler_t fn, void *d, bool udp) {
(void) m, (void) fn, (void) d, (void) udp;
MG_ERROR(("Not implemented"));