diff --git a/nx/include/switch/applets/web.h b/nx/include/switch/applets/web.h index f55e37db..258b3d03 100644 --- a/nx/include/switch/applets/web.h +++ b/nx/include/switch/applets/web.h @@ -77,9 +77,9 @@ void webWifiCreate(WebWifiConfig* config, const char* conntest_url, const char* Result webWifiShow(WebWifiConfig* config, WebWifiReturnValue *out); /** - * @brief Creates the config for WebApplet. + * @brief Creates the config for WebApplet. This applet uses an URL whitelist loaded from the user-process host title. * @param config WebPageConfig object. - * @param url Optional initial URL navigated to by the applet, can be NULL. + * @param url Initial URL navigated to by the applet. */ void webPageCreate(WebPageConfig* config, const char* url); diff --git a/nx/source/applets/web.c b/nx/source/applets/web.c index 6ab418af..f9675cf1 100644 --- a/nx/source/applets/web.c +++ b/nx/source/applets/web.c @@ -90,6 +90,8 @@ static void _webTLVWrite(void* buffer, size_t size, u16 type, const void* argdat if (size < offset + sizeof(WebArgTLV) + argdata_size) return; + tlv = (WebArgTLV*)&dataptr[offset]; + if (tlv->type != type) { tlv->type = type; tlv->size = argdata_size; @@ -124,11 +126,9 @@ void webPageCreate(WebPageConfig* config, const char* url) { u8 tmpval=1; _webTLVWrite(config->arg, sizeof(config->arg), 0x12, &tmpval, sizeof(tmpval)); /// Type was changed to 0xD with a newer version. - if (url) { - memset(tmpurl, 0, sizeof(tmpurl)); - strncpy(tmpurl, url, sizeof(tmpurl)-1); - _webTLVWrite(config->arg, sizeof(config->arg), 0x1, tmpurl, sizeof(tmpurl)); - } + memset(tmpurl, 0, sizeof(tmpurl)); + strncpy(tmpurl, url, sizeof(tmpurl)-1); + _webTLVWrite(config->arg, sizeof(config->arg), 0x1, tmpurl, sizeof(tmpurl)); } Result webPageShow(WebPageConfig* config, WebPageReturnValue *out) {