Skip to content

Commit

Permalink
doc/go1.17: document encoding/binary.Uvarint max read of 10 bytes
Browse files Browse the repository at this point in the history
Updates golang#41185
For golang#44513.
Fixes golang#46009

Change-Id: I60f4d891b897809765acc0aace037c78e95bb4f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/317929
Trust: Emmanuel Odeke <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
  • Loading branch information
odeke-em committed May 7, 2021
1 parent b44c78b commit af6123a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/go1.17.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,10 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
<dl id="encoding/binary"><dt><a href="/pkg/encoding/binary/">encoding/binary</a></dt>
<dd>
<p><!-- CL 299531 -->
TODO: <a href="https://golang.org/cl/299531">https://golang.org/cl/299531</a>: limit bytes read by Uvarint to &lt;= 10
<code>binary.Uvarint</code> will stop reading after <code>10 bytes</code> to avoid
wasted computations. If more than <code>10 bytes</code> are needed, the byte count returned is <code>-11</code>.
<br />
Previous Go versions could return larger negative counts when reading incorrectly encoded varints.
</p>
</dd>
</dl><!-- encoding/binary -->
Expand Down

0 comments on commit af6123a

Please sign in to comment.