<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sun Jan 12 12:12:04 UTC 2025

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[MC-6699] Reading Bytes in Minecraft code has a possible flaw</title>
                <link>https://bugs.mojang.com/browse/MC-6699</link>
                <project id="10400" key="MC">Minecraft: Java Edition</project>
                    <description>&lt;p&gt;I used MCP to debug a problem with my client, I stumbled across this code in Packet.class:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt;[] readBytesFromStream(DataInputStream par0DataInputStream) &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; IOException
    {
        &lt;span class=&quot;code-object&quot;&gt;short&lt;/span&gt; var1 = par0DataInputStream.readShort();

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (var1 &amp;lt; 0)
        {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; IOException(&lt;span class=&quot;code-quote&quot;&gt;&quot;Key was smaller than nothing!  Weird key!&quot;&lt;/span&gt;);
        }
        &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
        {
            &lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt;[] var2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt;[var1];
            par0DataInputStream.read(var2);
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; var2;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem lies in `par0DataInputStream.read(var2);`, it reads up to var2-bytes but not exactly var2-bytes.&lt;/p&gt;

&lt;p&gt;(already fixed by Dinnerbone, submitting it for the sake of completeness)&lt;/p&gt;</description>
                <environment></environment>
        <key id="19468">MC-6699</key>
            <summary>Reading Bytes in Minecraft code has a possible flaw</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="dinnerbone">[Mojang] Nathan Adams</assignee>
                                    <reporter username="dav1d">David Herberth</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Jan 2013 01:20:14 +0100</created>
                <updated>Thu, 10 Jan 2013 01:20:54 +0100</updated>
                            <resolved>Thu, 10 Jan 2013 01:20:43 +0100</resolved>
                                    <version>Minecraft 1.4.6</version>
                    <version>Minecraft 1.4.7</version>
                    <version>Snapshot 13w01b</version>
                                    <fixVersion>Snapshot 13w02a</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Unconfirmed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i04op3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>