Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions contrib/mcufont/encoder/encode_rlefont.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ static DictTreeNode *find_tree_node(DataFile::pixels_t::const_iterator begin,
DictTreeNode *root)
{
DictTreeNode* node = root;
if (!node)
return nullptr;

while (begin != end)
{
uint8_t pixel = *begin++;
Expand Down
4 changes: 2 additions & 2 deletions contrib/mcufont/encoder/freetype_import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _FT_Library
{
public:
_FT_Library() { checkFT(FT_Init_FreeType(&m_lib)); }
~_FT_Library() { checkFT(FT_Done_FreeType(m_lib)); }
~_FT_Library() { FT_Done_FreeType(m_lib); }
operator FT_Library() { return m_lib; }

private:
Expand All @@ -51,7 +51,7 @@ class _FT_Face
checkFT(FT_New_Memory_Face(lib, (const unsigned char *)&data[0],
data.size(), 0, &m_face));
}
~_FT_Face() { checkFT(FT_Done_Face(m_face)); }
~_FT_Face() { FT_Done_Face(m_face); }
operator FT_Face() { return m_face; }
FT_Face operator->() { return m_face; }

Expand Down
10 changes: 10 additions & 0 deletions lib/core-net/client/connect2.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ lws_getaddrinfo46(struct lws *wsi, const char *ads, struct addrinfo **result)
char buckname[32];
#endif
int n;
uint8_t naddr[16];

memset(&hints, 0, sizeof(hints));
*result = NULL;
Expand All @@ -78,6 +79,15 @@ lws_getaddrinfo46(struct lws *wsi, const char *ads, struct addrinfo **result)
hints.ai_family = PF_UNSPEC;
}

/*
* If the address is already a numeric IPv4 or IPv6 literal, set
* AI_NUMERICHOST so that getaddrinfo() resolves it locally without
* issuing any DNS query (which would be wrong, and on lwIP/FreeRTOS
* would produce a spurious DNS A request for a link-local address).
*/
if (lws_parse_numeric_address(ads, naddr, sizeof(naddr)) > 0)
hints.ai_flags |= AI_NUMERICHOST;

#if defined(LWS_WITH_CONMON)
wsi->conmon_datum = lws_now_usecs();
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,10 @@ test_genaes_branch_matrix(void)
if (basic_cases[n].mode == LWS_GAESM_CTR ||
basic_cases[n].mode == LWS_GAESM_XTS)
continue;
#endif
#if defined(LWS_WITH_MBEDTLS) && defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_NUMBER >= 0x04000000
if (basic_cases[n].mode == LWS_GAESM_XTS)
continue;
#endif
if (lws_genaes_run_hex_case(&basic_cases[n])) {
lwsl_err("%s: basic_cases[%d] failed\n", __func__, n);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <libwebsockets.h>
#include <stdlib.h>

#if !defined(LWS_WITH_GNUTLS)
#if !defined(LWS_WITH_GNUTLS) && !(defined(LWS_WITH_MBEDTLS) && defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_NUMBER >= 0x03000000)
static int
test_genrsa_roundtrips(struct lws_context *context)
{
Expand Down Expand Up @@ -297,21 +297,21 @@ test_genrsa_fixed_vectors(struct lws_context *context)
int
test_genrsa(struct lws_context *context)
{
#if !defined(LWS_WITH_GNUTLS)
#if !defined(LWS_WITH_GNUTLS) && !(defined(LWS_WITH_MBEDTLS) && defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_NUMBER >= 0x03000000)
if (test_genrsa_roundtrips(context))
goto bail;

if (test_genrsa_fixed_vectors(context))
goto bail;
#else
lwsl_notice("%s: Skipping RSA encrypt/decrypt tests (unsupported on GnuTLS)\n", __func__);
lwsl_notice("%s: Skipping RSA encrypt/decrypt tests (unsupported on this backend)\n", __func__);
#endif

lwsl_notice("%s: selftest OK\n", __func__);

return 0;

#if !defined(LWS_WITH_GNUTLS)
#if !defined(LWS_WITH_GNUTLS) && !(defined(LWS_WITH_MBEDTLS) && defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_NUMBER >= 0x03000000)
bail:
lwsl_err("%s: selftest failed ++++++++++++++++++++\n", __func__);

Expand Down
4 changes: 2 additions & 2 deletions minimal-examples-lowlevel/api-tests/api-test-x509/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ int main(int argc, const char **argv)
goto bail;
}

if (memcmp(big + sizeof(*res) - sizeof(res->ns.name),
expected_spki, (size_t)res->ns.len)) {
size_t name_offset = (size_t)((uint8_t *)&res->ns.name - (uint8_t *)res);
if (memcmp(big + name_offset, expected_spki, (size_t)res->ns.len)) {
lwsl_err("SPKI content mismatch\n");
ret = 1;
goto bail;
Expand Down
1 change: 1 addition & 0 deletions minimal-examples/embedded/lhp/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
do_reboot(void)
{
esp_restart();
return 0;
}

static int
Expand Down Expand Up @@ -526,5 +527,5 @@
spin:
vTaskDelay(10);
taskYIELD();
goto spin;

Check failure on line 530 in minimal-examples/embedded/lhp/main.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This goto statement must be replaced by a standard iteration statement.

See more on https://sonarcloud.io/project/issues?id=warmcat_libwebsockets&issues=AZ7e4VQZUv3oLpQCxFx-&open=AZ7e4VQZUv3oLpQCxFx-&pullRequest=3609
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ int gettimeofday(struct timeval *tv, void *tx)

tv->tv_sec = u / 1000000;
tv->tv_usec = u - (tv->tv_sec * 1000000);

return 0;
}

long long atoll(const char *s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2339,7 +2339,10 @@ lws_acme_core_cert_aging(struct per_vhost_data__lws_acme_client *vhd,
const struct lws_acme_cert_aging_args *caa)
{
if (!vhd || !vhd->cert_configs.head) {
lwsl_vhost_notice(vhd->vhost, "acme_aging: aborting, no vhd or cert_configs.head is empty\n");
if (vhd)
lwsl_vhost_notice(vhd->vhost, "acme_aging: aborting, cert_configs.head is empty\n");
else
lwsl_notice("acme_aging: aborting, no vhd\n");
return 0;
}

Expand Down
Loading