mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-06 15:51:25 +00:00
no VLA
This commit is contained in:
1 parent
578e52618d
commit
6f2dcf92a7
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -4365,8 +4365,8 @@ static void tx_dhcp_request_sel(struct mg_tcpip_if *ifp, uint32_t ip_req,
|
|||||||
(ifp->enable_req_sntp ? 1 : 0));
|
(ifp->enable_req_sntp ? 1 : 0));
|
||||||
size_t len = strlen(ifp->dhcp_name);
|
size_t len = strlen(ifp->dhcp_name);
|
||||||
size_t olen = 21 + len + extra + 2 + 1; // Total length of options
|
size_t olen = 21 + len + extra + 2 + 1; // Total length of options
|
||||||
uint8_t opts_maxlen = 21 + sizeof(ifp->dhcp_name) + 2 + 2 + 1;
|
#define OPTS_MAXLEN (21 + sizeof(ifp->dhcp_name) + 2 + 2 + 1)
|
||||||
uint8_t opts[opts_maxlen]; // Allocate options (max size possible)
|
uint8_t opts[OPTS_MAXLEN]; // Allocate options (max size possible)
|
||||||
uint8_t *p = opts;
|
uint8_t *p = opts;
|
||||||
assert(olen <= sizeof(opts));
|
assert(olen <= sizeof(opts));
|
||||||
memset(opts, 0, sizeof(opts));
|
memset(opts, 0, sizeof(opts));
|
||||||
|
|||||||
+2
-2
@@ -284,8 +284,8 @@ static void tx_dhcp_request_sel(struct mg_tcpip_if *ifp, uint32_t ip_req,
|
|||||||
(ifp->enable_req_sntp ? 1 : 0));
|
(ifp->enable_req_sntp ? 1 : 0));
|
||||||
size_t len = strlen(ifp->dhcp_name);
|
size_t len = strlen(ifp->dhcp_name);
|
||||||
size_t olen = 21 + len + extra + 2 + 1; // Total length of options
|
size_t olen = 21 + len + extra + 2 + 1; // Total length of options
|
||||||
uint8_t opts_maxlen = 21 + sizeof(ifp->dhcp_name) + 2 + 2 + 1;
|
#define OPTS_MAXLEN (21 + sizeof(ifp->dhcp_name) + 2 + 2 + 1)
|
||||||
uint8_t opts[opts_maxlen]; // Allocate options (max size possible)
|
uint8_t opts[OPTS_MAXLEN]; // Allocate options (max size possible)
|
||||||
uint8_t *p = opts;
|
uint8_t *p = opts;
|
||||||
assert(olen <= sizeof(opts));
|
assert(olen <= sizeof(opts));
|
||||||
memset(opts, 0, sizeof(opts));
|
memset(opts, 0, sizeof(opts));
|
||||||
|
|||||||
Reference in new issue
Block a user