1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-24 09:08:49 -05:00

glob: pass an 'int' as len when using printf's %*s

Detected by Coverity CID 1486629.

Closes #7324
This commit is contained in:
Daniel Stenberg 2021-06-30 12:47:43 +02:00
parent 97fa671a73
commit 8feeafc61a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -472,7 +472,7 @@ CURLcode glob_url(struct URLGlob **glob, char *url, unsigned long *urlnum,
if(glob_expand->pos) {
msnprintf(text, sizeof(text), "%s in URL position %zu:\n%s\n%*s^",
glob_expand->error,
glob_expand->pos, url, glob_expand->pos - 1, " ");
glob_expand->pos, url, (int)glob_expand->pos - 1, " ");
t = text;
}
else