Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6038)

Unified Diff: chrome/browser/ssl/ssl_error_info.cc

Issue 10827364: Properly EscapeForHTML potentially malicious input from X.509 certificates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_error_info.cc
===================================================================
--- chrome/browser/ssl/ssl_error_info.cc (revision 151708)
+++ chrome/browser/ssl/ssl_error_info.cc (working copy)
@@ -12,6 +12,7 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "net/base/cert_status_flags.h"
+#include "net/base/escape.h"
#include "net/base/net_errors.h"
#include "net/base/ssl_info.h"
#include "ui/base/l10n/l10n_util.h"
@@ -55,7 +56,8 @@
details =
l10n_util::GetStringFUTF16(IDS_CERT_ERROR_COMMON_NAME_INVALID_DETAILS,
UTF8ToUTF16(request_url.host()),
- UTF8ToUTF16(dns_names[i]),
+ net::EscapeForHTML(
+ UTF8ToUTF16(dns_names[i])),
UTF8ToUTF16(request_url.host()));
short_description = l10n_util::GetStringUTF16(
IDS_CERT_ERROR_COMMON_NAME_INVALID_DESCRIPTION);
@@ -64,7 +66,7 @@
extra_info.push_back(
l10n_util::GetStringFUTF16(
IDS_CERT_ERROR_COMMON_NAME_INVALID_EXTRA_INFO_2,
- UTF8ToUTF16(cert->subject().common_name),
+ net::EscapeForHTML(UTF8ToUTF16(cert->subject().common_name)),
UTF8ToUTF16(request_url.host())));
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698