Skip to content

Commit a96a0af

Browse files
committed
File name should be html-escaped
1 parent 5a68759 commit a96a0af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def print_frame(context, frame_id, current_frame_id)
7979
# idx + 1: one-based numbering as classic-debugger
8080
file = context.frame_file(frame_id)
8181
print "<frame no=\"%s\" file=\"%s\" line=\"%s\" #{"current='true' " if frame_id == current_frame_id}/>",
82-
frame_id + 1, File.expand_path(file), context.frame_line(frame_id)
82+
frame_id + 1, CGI.escapeHTML(File.expand_path(file)), context.frame_line(frame_id)
8383
end
8484

8585
def print_contexts(contexts)
@@ -282,7 +282,7 @@ def print_trace(context, file, line)
282282

283283
def print_at_line(context, file, line)
284284
print "<suspended file=\"%s\" line=\"%s\" threadId=\"%d\" frames=\"%d\"/>",
285-
File.expand_path(file), line, context.thnum, context.stack_size
285+
CGI.escapeHTML(File.expand_path(file)), line, context.thnum, context.stack_size
286286
end
287287

288288
def print_exception(exception, _)

0 commit comments

Comments
 (0)