提交 d7267d55 编写于 作者: J Junio C Hamano

Merge branch 'md/url-parse-harden' into maint

The URL decoding code has been updated to avoid going past the end
of the string while parsing %-<hex>-<hex> sequence.

* md/url-parse-harden:
  url: do not allow %00 to represent NUL in URLs
  url: do not read past end of buffer
......@@ -46,9 +46,9 @@ static char *url_decode_internal(const char **query, int len,
break;
}
if (c == '%') {
if (c == '%' && (len < 0 || len >= 3)) {
int val = hex2chr(q + 1);
if (0 <= val) {
if (0 < val) {
strbuf_addch(out, val);
q += 3;
len -= 3;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册