|
@@ -50,16 +50,17 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
50
|
50
|
*/
|
51
|
51
|
int imgdownload ( struct uri *uri, unsigned long timeout,
|
52
|
52
|
struct image **image ) {
|
53
|
|
- const char *password;
|
|
53
|
+ struct uri uri_redacted;
|
54
|
54
|
char *uri_string_redacted;
|
55
|
55
|
int rc;
|
56
|
56
|
|
57
|
57
|
/* Construct redacted URI */
|
58
|
|
- password = uri->password;
|
59
|
|
- if ( password )
|
60
|
|
- uri->password = "***";
|
61
|
|
- uri_string_redacted = format_uri_alloc ( uri );
|
62
|
|
- uri->password = password;
|
|
58
|
+ memcpy ( &uri_redacted, uri, sizeof ( uri_redacted ) );
|
|
59
|
+ uri_redacted.user = NULL;
|
|
60
|
+ uri_redacted.password = NULL;
|
|
61
|
+ uri_redacted.query = NULL;
|
|
62
|
+ uri_redacted.fragment = NULL;
|
|
63
|
+ uri_string_redacted = format_uri_alloc ( &uri_redacted );
|
63
|
64
|
if ( ! uri_string_redacted ) {
|
64
|
65
|
rc = -ENOMEM;
|
65
|
66
|
goto err_uri_string;
|