We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1638df9 + 1dfb222 commit 2ac8737Copy full SHA for 2ac8737
components/esp_webrtc/impl/whip_signal/whip_signaling.c
@@ -192,7 +192,7 @@ static char *get_auth_header(esp_peer_signaling_whip_cfg_t *whip_cfg)
192
size_t token_len = cfg_len;
193
int auth_len = (whip_cfg->auth_type == ESP_PEER_SIGNALING_WHIP_AUTH_TYPE_BASIC) ? strlen("Authorization: Basic ") : strlen("Authorization: Bearer ");
194
if (whip_cfg->auth_type == ESP_PEER_SIGNALING_WHIP_AUTH_TYPE_BASIC) {
195
- token_len = (token_len * 4 / 3) + 2;
+ token_len = ((token_len + 2) / 3) * 4 + 1;
196
}
197
int len = auth_len + token_len + 1;
198
char *auth = malloc(len);
0 commit comments