Skip to content

Commit cb4a251

Browse files
committed
Document why the parse_escape recursion is not dangerous
1 parent 7911e70 commit cb4a251

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/read.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,10 @@ fn parse_escape<'de, R: Read<'de>>(
907907
]);
908908

909909
// The \ prior to this byte started an escape sequence,
910-
// so we need to parse that now.
910+
// so we need to parse that now. This recursive call
911+
// does not blow the stack on malicious input because
912+
// the escape is not \u, so it will be handled by one
913+
// of the easy nonrecursive cases.
911914
return parse_escape(read, validate, scratch);
912915
}
913916
read.discard();

0 commit comments

Comments
 (0)