Skip to content

Commit 0dc15a9

Browse files
committed
js: Fix externally-controlled format strings
CodeQL is now complaining about these. This should be okay since we only talk to ourselves, but better to be safe about it.
1 parent cf6069a commit 0dc15a9

File tree

1 file changed

+5
-3
lines changed
  • lib/matplotlib/backends/web_backend/js

1 file changed

+5
-3
lines changed

lib/matplotlib/backends/web_backend/js/mpl.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,21 @@ mpl.figure.prototype._make_on_message_function = function (fig) {
575575
var callback = fig['handle_' + msg_type];
576576
} catch (e) {
577577
console.log(
578-
"No handler for the '" + msg_type + "' message type: ",
578+
"No handler for the '%s' message type: ",
579+
msg_type,
579580
msg
580581
);
581582
return;
582583
}
583584

584585
if (callback) {
585586
try {
586-
// console.log("Handling '" + msg_type + "' message: ", msg);
587+
// console.log("Handling '%s' message: ", msg_type, msg);
587588
callback(fig, msg);
588589
} catch (e) {
589590
console.log(
590-
"Exception inside the 'handler_" + msg_type + "' callback:",
591+
"Exception inside the 'handler_%s' callback:",
592+
msg_type,
591593
e,
592594
e.stack,
593595
msg

0 commit comments

Comments
 (0)