]> diplodocus.org Git - nmh/blobdiff - sbr/oauth.c
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
[nmh] / sbr / oauth.c
index f195e6fe45934b47e3cfde576d05ea4c27cb0e63..2aedf82c3a2f2fe34d2edb9fdb2e51aab7b28324 100755 (executable)
@@ -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 = "?";
     }