<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:12 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-2431] _mongoc_client_command_with_opts segfault with empty command document</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2431</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;A PHPC test happened to use an empty command document in an error test and inadvertently caused a segfault within libmongoc when the command name is checked. The relevant bit of the backtrace is:&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;#0  __strcasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164&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;No locals.&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;#1  0x00007f91620aec21 in mongoc_cmd_parts_append_opts (parts=0x7fff1cabe060, iter=0x7fff1cabdf90, max_wire_version=6, error=0x7fff1cabe540)&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;    at /home/jmikola/workspace/mongodb/phpc/src/libmongoc/src/mongoc/mongoc-cmd.c:124&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;#2  0x00007f91620a304d in _mongoc_client_command_with_opts (client=0x20ac4f0, db_name=0x7f916ab80d88 &quot;phongo&quot;, command=0x20aa530, mode=MONGOC_CMD_READ, &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;    opts=0x7fff1cabe440, flags=MONGOC_QUERY_NONE, default_prefs=0x20ad000, default_rc=0x20acf60, default_wc=0x20aceb0, reply=0x7fff1cabe3c0, error=0x7fff1cabe540)&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;    at /home/jmikola/workspace/mongodb/phpc/src/libmongoc/src/mongoc/mongoc-client.c:1778&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;The point of the exception is &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0-rc1/src/mongoc/mongoc-cmd.c#L122&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this line in &lt;tt&gt;mongoc_cmd_parts_append_opts()&lt;/tt&gt;&lt;/a&gt; when checking if the command is &quot;findAndModify&quot;. Note that a similar check happens higher up in &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0-rc1/src/mongoc/mongoc-client.c#L1787&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;_mongoc_client_command_with_opts()&lt;/tt&gt;&lt;/a&gt; when deciding if a default write concern should be applied.&lt;/p&gt;

&lt;p&gt;An additional point of interest may be &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0-rc1/src/mongoc/mongoc-cursor.c#L1362&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;_mongoc_cursor_run_command()&lt;/tt&gt;&lt;/a&gt; when checking for a &quot;getMore&quot; command.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;_mongoc_get_command_name()&lt;/tt&gt; is also used to &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0-rc1/src/mongoc/mongoc-cmd.c#L570&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;assign &lt;tt&gt;parts-&amp;gt;assembled.command_name&lt;/tt&gt; in &lt;tt&gt;mongoc_cmd_parts_assemble()&lt;/tt&gt;&lt;/a&gt; but an error is raised for an empty command document if the name is &lt;tt&gt;NULL&lt;/tt&gt;. &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0-rc1/src/mongoc/mongoc-cursor-cursorid.c#L130&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;mongoc-cursor-cursorid.c&lt;/tt&gt; also calls &lt;tt&gt;_mongoc_get_command_name()&lt;/tt&gt;&lt;/a&gt; to craft an error message; however, that should not be a concern as printf patterns should be able to handle NULL &lt;tt&gt;char *&lt;/tt&gt; values.&lt;/p&gt;</description>
                <environment></environment>
        <key id="472808">CDRIVER-2431</key>
            <summary>_mongoc_client_command_with_opts segfault with empty command document</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="13201">Fixed</resolution>
                                        <assignee username="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Dec 2017 04:13:11 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:14 +0000</updated>
                            <resolved>Wed, 20 Dec 2017 18:03:31 +0000</resolved>
                                                    <fixVersion>1.9.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1757538" author="xgen-internal-githook" created="Thu, 21 Dec 2017 04:04:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: Regression test for empty command segfault (&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2431&quot; title=&quot;_mongoc_client_command_with_opts segfault with empty command document&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2431&quot;&gt;&lt;del&gt;CDRIVER-2431&lt;/del&gt;&lt;/a&gt;)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-php-driver/commit/bfbbbf1babac0d866f9794e3a30efed3bceff0f8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-php-driver/commit/bfbbbf1babac0d866f9794e3a30efed3bceff0f8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1757014" author="xgen-internal-githook" created="Wed, 20 Dec 2017 18:01:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2431&quot; title=&quot;_mongoc_client_command_with_opts segfault with empty command document&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2431&quot;&gt;&lt;del&gt;CDRIVER-2431&lt;/del&gt;&lt;/a&gt; check for empty command before comparing name&lt;br/&gt;
Branch: r1.9&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/471bfb037e8e380dde9409ba318a66f491d003be&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/471bfb037e8e380dde9409ba318a66f491d003be&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1757013" author="xgen-internal-githook" created="Wed, 20 Dec 2017 17:59:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2431&quot; title=&quot;_mongoc_client_command_with_opts segfault with empty command document&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2431&quot;&gt;&lt;del&gt;CDRIVER-2431&lt;/del&gt;&lt;/a&gt; check for empty command before comparing name&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/85c5726b106ccd5f42b9c5c5fc9ea0a10818a414&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/85c5726b106ccd5f42b9c5c5fc9ea0a10818a414&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1756264" author="jmikola@gmail.com" created="Tue, 19 Dec 2017 22:32:20 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/477&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/477&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1756178" author="jesse" created="Tue, 19 Dec 2017 21:17:45 +0000"  >&lt;p&gt;Jeremy do you want to submit a PR for this please?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="471235">PHPC-1066</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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|htdx7b:</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>