parent
25b4285c4d
commit
0472587c4c
|
@ -326,7 +326,7 @@ static int coap_request( lua_State* L, coap_method_t m )
|
||||||
stack++;
|
stack++;
|
||||||
pesp_conn = cud->pesp_conn;
|
pesp_conn = cud->pesp_conn;
|
||||||
ip_addr_t ipaddr;
|
ip_addr_t ipaddr;
|
||||||
uint8_t host[32];
|
uint8_t host[64];
|
||||||
|
|
||||||
unsigned t;
|
unsigned t;
|
||||||
if ( lua_isnumber(L, stack) )
|
if ( lua_isnumber(L, stack) )
|
||||||
|
@ -348,6 +348,9 @@ static int coap_request( lua_State* L, coap_method_t m )
|
||||||
coap_uri_t *uri = coap_new_uri(url, l); // should call free(uri) somewhere
|
coap_uri_t *uri = coap_new_uri(url, l); // should call free(uri) somewhere
|
||||||
if (uri == NULL)
|
if (uri == NULL)
|
||||||
return luaL_error( L, "uri wrong format." );
|
return luaL_error( L, "uri wrong format." );
|
||||||
|
if (uri->host.length + 1 /* for the null */ > sizeof(host)) {
|
||||||
|
return luaL_error(L, "host too long");
|
||||||
|
}
|
||||||
|
|
||||||
pesp_conn->proto.udp->remote_port = uri->port;
|
pesp_conn->proto.udp->remote_port = uri->port;
|
||||||
NODE_DBG("UDP port is set: %d.\n", uri->port);
|
NODE_DBG("UDP port is set: %d.\n", uri->port);
|
||||||
|
|
Loading…
Reference in New Issue