<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:08:45 UTC 2024

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>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CDRIVER-200] Memory scribble in &apos;bson_append&apos; when level of nested objects exceeds 32</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-200</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The &apos;bson&apos; structure currently has a hard-coded internal &apos;stack&apos; of 32 elements. Overflow of this stack is not checked, and happens when you exceed 32 nested objects / arrays with bson_append_start_object / bson_append_start_array.&lt;/p&gt;

&lt;p&gt;This is obviously by design, so I&apos;m not sure how well this will be received, but I have implemented a patch (I&apos;ll attach a pull request later) in which this fixed-size stack is replaced with a dynamically resized stack. When resized, the stack is incremented by 32, so the additional cost for existing code is 1 malloc when the first object is appended, and 1 free when the structure is free&apos;d. I&apos;ve also added an additional unit test for deep nesting of bson objects, verified this patch by running it through all tests with valgrind.&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="66947">CDRIVER-200</key>
            <summary>Memory scribble in &apos;bson_append&apos; when level of nested objects exceeds 32</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="gjmurakami">Gary Murakami</assignee>
                                    <reporter username="jbrd">James Bird</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Mar 2013 11:39:02 +0000</created>
                <updated>Wed, 19 Oct 2016 14:14:57 +0000</updated>
                            <resolved>Tue, 5 Mar 2013 03:13:14 +0000</resolved>
                                    <version>0.7.1</version>
                                    <fixVersion>0.8.1</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="281467" author="gjmurakami" created="Tue, 5 Mar 2013 03:13:14 +0000"  >&lt;p&gt;James, thanks a lot for your quick response to my suggestions and for an efficient working solution.&lt;/p&gt;</comment>
                            <comment id="279897" author="auto" created="Sat, 2 Mar 2013 19:45:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-03-02T19:45:13Z&apos;, u&apos;name&apos;: u&apos;gjmurakami-10gen&apos;, u&apos;email&apos;: u&apos;gary.murakami@10gen.com&apos;}
&lt;p&gt;Message: Merge pull request #84 from jbrd/master&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-200&quot; title=&quot;Memory scribble in &amp;#39;bson_append&amp;#39; when level of nested objects exceeds 32&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-200&quot;&gt;&lt;del&gt;CDRIVER-200&lt;/del&gt;&lt;/a&gt; Memory scribble in &apos;bson_append&apos; when level of nested objects exceeds 32&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/537363726e4b4ec287ce8e776fdffd831352b37c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/537363726e4b4ec287ce8e776fdffd831352b37c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="279896" author="auto" created="Sat, 2 Mar 2013 19:45:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-03-02T16:58:47Z&apos;, u&apos;name&apos;: u&apos;James Bird&apos;, u&apos;email&apos;: u&apos;jsb@dneg.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-200&quot; title=&quot;Memory scribble in &amp;#39;bson_append&amp;#39; when level of nested objects exceeds 32&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-200&quot;&gt;&lt;del&gt;CDRIVER-200&lt;/del&gt;&lt;/a&gt; _bson_append_grow_stack now doubles stack size, initially uses struct-local fixed-sized stack to avoid initial malloc&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/b1ea6e7bb3f5c16a73b627e5c343cf9814890346&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/b1ea6e7bb3f5c16a73b627e5c343cf9814890346&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="279895" author="auto" created="Sat, 2 Mar 2013 19:45:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-03-01T12:15:52Z&apos;, u&apos;name&apos;: u&apos;James Bird&apos;, u&apos;email&apos;: u&apos;jsb@dneg.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-200&quot; title=&quot;Memory scribble in &amp;#39;bson_append&amp;#39; when level of nested objects exceeds 32&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-200&quot;&gt;&lt;del&gt;CDRIVER-200&lt;/del&gt;&lt;/a&gt; Memory scribble in &apos;bson_append&apos; when level of nested objects exceeds 32&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/62e25d485b4e8b71cb440a99d019511f3b12fa15&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/62e25d485b4e8b71cb440a99d019511f3b12fa15&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="278945" author="jbrd" created="Fri, 1 Mar 2013 12:23:03 +0000"  >&lt;p&gt;Link to pull request: &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/84&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/84&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrmg4v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>44577</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>