<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:14:04 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-2072] Using a filter or projection with empty field names causes a crash when destroying cursor</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2072</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;When running a query through &lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongoc_collection_find_with_opts&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt; where opts is invalid (i.e. &quot;Cannot use empty keys in &apos;opts&apos;.&quot;), a subsequent mongoc_cursor_destroy crashes, even though find_with_opts&apos; documentation says I need to destroy the cursor.&lt;/p&gt;

&lt;p&gt;See the attached file, which I&apos;ve compiled with &lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;gcc test.c -ggdb3 -o test536 $(pkg-config --cflags --libs libmongoc-1.0)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;&lt;/p&gt;

&lt;p&gt;When running it, it produces a segfault:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;derick@singlemalt:/tmp/536 $ ./test536 &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;An error occurred: Cannot use empty keys in &apos;opts&apos;.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Segmentation fault&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;I have also attached the backtrace.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="357465">CDRIVER-2072</key>
            <summary>Using a filter or projection with empty field names causes a crash when destroying cursor</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="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="derick">Derick Rethans</reporter>
                        <labels>
                    </labels>
                <created>Mon, 27 Feb 2017 11:00:30 +0000</created>
                <updated>Tue, 28 Mar 2017 17:19:21 +0000</updated>
                            <resolved>Sun, 5 Mar 2017 19:24:31 +0000</resolved>
                                    <version>1.5.1</version>
                    <version>1.5.2</version>
                                    <fixVersion>1.5.5</fixVersion>
                    <fixVersion>1.6.1</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1516271" author="jesse" created="Sun, 5 Mar 2017 19:24:27 +0000"  >&lt;p&gt;r1.6: &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/aadf9bcb416e76e2771de2578bd5013f764b80d2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/aadf9bcb416e76e2771de2578bd5013f764b80d2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1516270" author="xgen-internal-githook" created="Sun, 5 Mar 2017 19:23:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jmikola&apos;, u&apos;name&apos;: u&apos;Jeremy Mikola&apos;, u&apos;email&apos;: u&apos;jmikola@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2072&quot; title=&quot;Using a filter or projection with empty field names causes a crash when destroying cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2072&quot;&gt;&lt;del&gt;CDRIVER-2072&lt;/del&gt;&lt;/a&gt;: Always initialize cursor filter and opts&lt;/p&gt;

&lt;p&gt;mongoc_cursor_destroy() always attempts to destroy these documents, which would previously crash if they were left uninitialized when an error was reported by _mongoc_cursor_new_with_opts().&lt;br/&gt;
Branch: r1.5&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e8c89c0b3bc8696092c47a0e658e5f2e9eb8beda&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e8c89c0b3bc8696092c47a0e658e5f2e9eb8beda&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1516257" author="xgen-internal-githook" created="Sun, 5 Mar 2017 17:19:07 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@emptysquare.net&apos;}
&lt;p&gt;Message: Merge pull request #425 from jmikola/cdriver-2072&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2072&quot; title=&quot;Using a filter or projection with empty field names causes a crash when destroying cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2072&quot;&gt;&lt;del&gt;CDRIVER-2072&lt;/del&gt;&lt;/a&gt;: Always initialize cursor filter and opts&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/de0e30a0c8fdd109b8bb99becbb37d4bfb73395d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/de0e30a0c8fdd109b8bb99becbb37d4bfb73395d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1516256" author="xgen-internal-githook" created="Sun, 5 Mar 2017 17:19:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jmikola&apos;, u&apos;name&apos;: u&apos;Jeremy Mikola&apos;, u&apos;email&apos;: u&apos;jmikola@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2072&quot; title=&quot;Using a filter or projection with empty field names causes a crash when destroying cursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2072&quot;&gt;&lt;del&gt;CDRIVER-2072&lt;/del&gt;&lt;/a&gt;: Always initialize cursor filter and opts&lt;/p&gt;

&lt;p&gt;mongoc_cursor_destroy() always attempts to destroy these documents, which would previously crash if they were left uninitialized when an error was reported by _mongoc_cursor_new_with_opts().&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/fe277d1e3d247e80cd630a082ed29e0f0eb2a1f3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/fe277d1e3d247e80cd630a082ed29e0f0eb2a1f3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1515711" author="jmikola@gmail.com" created="Fri, 3 Mar 2017 20:15:39 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/425&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/425&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1515670" author="jmikola@gmail.com" created="Fri, 3 Mar 2017 19:37:29 +0000"  >&lt;p&gt;Verified that this is also an issue when the filter document contains empty field names.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="357982">PHPC-920</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="367836">CDRIVER-2100</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="150336" name="536.gdb.txt" size="2911" author="derick" created="Mon, 27 Feb 2017 11:23:11 +0000"/>
                            <attachment id="150337" name="test.c" size="1650" author="derick" created="Mon, 27 Feb 2017 11:23:04 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <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|hsvj93:</customfieldvalue>

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