瀏覽代碼

allow null bytes in bearer tokens

(Haven't decided what to do at the spec level yet)
tags/v2.14.0-rc1
Shivaram Lingamneni 1 月之前
父節點
當前提交
794b4a2483
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      irc/handlers.go

+ 1
- 1
irc/handlers.go 查看文件

@@ -311,7 +311,7 @@ func authIRCv3BearerHandler(server *Server, client *Client, session *Session, va
311 311
 	defer session.sasl.Clear()
312 312
 
313 313
 	// <authzid> \x00 <type> \x00 <token>
314
-	splitValue := bytes.Split(value, []byte{'\000'})
314
+	splitValue := bytes.SplitN(value, []byte{'\000'}, 3)
315 315
 	if len(splitValue) != 3 {
316 316
 		rb.Add(nil, server.name, ERR_SASLFAIL, client.Nick(), client.t("SASL authentication failed: Invalid auth blob"))
317 317
 		return false

Loading…
取消
儲存