X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/dad91212b8df0f772eda9037ed86cbd137cf1a7d..92dd7b914b878f2172b4d436e9643c4a0d24683b:/sbr/oauth.c diff --git a/sbr/oauth.c b/sbr/oauth.c index f195e6fe..2aedf82c 100755 --- a/sbr/oauth.c +++ b/sbr/oauth.c @@ -366,7 +366,7 @@ mh_oauth_get_err_string(mh_oauth_ctx *ctx) base = "unknown error"; } if (ctx->err_details == NULL) { - return ctx->err_formatted = getcpy(base); + return ctx->err_formatted = mh_xstrdup(base); } ctx->err_formatted = concat(base, ": ", ctx->err_details, NULL); @@ -840,7 +840,10 @@ make_query_url(char *s, size_t size, CURL *curl, const char *base_url, ...) len = 0; prefix = ""; } else { - len = sprintf(s, "%s", base_url); + len = strlen(base_url); + if (len > size - 1) /* Less one for NUL. */ + return FALSE; + strcpy(s, base_url); prefix = "?"; }