<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>71921</bug_id>
          
          <creation_ts>2011-11-09 08:23:07 -0800</creation_ts>
          <short_desc>Remove use of strcpy in KURL</short_desc>
          <delta_ts>2011-11-15 11:57:30 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>72387</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>darin</cc>
    
    <cc>koivisto</cc>
    
    <cc>sam</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>498985</commentid>
    <comment_count>0</comment_count>
      <attachid>114288</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-09 08:23:07 -0800</bug_when>
    <thetext>Created attachment 114288
Patch

Reviewed by NOBODY (OOPS!).

* platform/KURL.cpp:
(WebCore::KURL::init): Replace strcat() with strncat().
---
 2 files changed, 14 insertions(+), 2 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>498986</commentid>
    <comment_count>1</comment_count>
      <attachid>114288</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-09 08:24:43 -0800</bug_when>
    <thetext>Comment on attachment 114288
Patch

Oops...left a fprintf in there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>498987</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-11-09 08:24:47 -0800</bug_when>
    <thetext>Attachment 114288 did not pass style-queue:

Failed to run &quot;[&apos;Tools/Scripts/check-webkit-style&apos;, &apos;--diff-files&apos;, u&apos;Source/WebCore/ChangeLog&apos;, u&apos;Source/WebCor...&quot; exit_code: 1

Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499001</commentid>
    <comment_count>3</comment_count>
      <attachid>114291</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-09 08:38:46 -0800</bug_when>
    <thetext>Created attachment 114291
Patch v2

Removed fprintf statement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499002</commentid>
    <comment_count>4</comment_count>
      <attachid>114291</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-09 08:41:21 -0800</bug_when>
    <thetext>Comment on attachment 114291
Patch v2

Oops.  Need to subtract 1 from third argument to make sure the string is null-terminated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499004</commentid>
    <comment_count>5</comment_count>
      <attachid>114291</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-09 08:43:05 -0800</bug_when>
    <thetext>Comment on attachment 114291
Patch v2

Nevermind...that&apos;s checked by the ASSERT below.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499012</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-09 08:48:11 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 114291 [details])
&gt; Oops.  Need to subtract 1 from third argument to make sure the string is null-terminated.

Also, that won&apos;t cause the string to be NULL-terminated.  The strlen(s2) must be less than n for that to hold.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499023</commentid>
    <comment_count>7</comment_count>
      <attachid>114291</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2011-11-09 08:58:35 -0800</bug_when>
    <thetext>Comment on attachment 114291
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=114291&amp;action=review

&gt; Source/WebCore/ChangeLog:3
&gt; +        &lt;http://webkit.org/b/71921&gt; Remove use of strcat in KURL

strcpy, not strcat!

And a personal style nit, I think it would look better on two lines:
Remove use of strcpy in KURL
&lt;http://webkit.org/b/71921&gt;

&gt; Source/WebCore/platform/KURL.cpp:552
&gt; -                strcpy(bufferPos, relStringPos);
&gt; +                strncpy(bufferPos, relStringPos, parserBufferSize - (bufferPosStart - bufferPos));

This looks backwards, shouldn&apos;t it be (bufferPos - bufferPosStart)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499028</commentid>
    <comment_count>8</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-09 09:03:20 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 114291 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=114291&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:3
&gt; &gt; +        &lt;http://webkit.org/b/71921&gt; Remove use of strcat in KURL
&gt; 
&gt; strcpy, not strcat!

Wow, it&apos;s too early.

&gt; And a personal style nit, I think it would look better on two lines:
&gt; Remove use of strcpy in KURL
&gt; &lt;http://webkit.org/b/71921&gt;
&gt; 
&gt; &gt; Source/WebCore/platform/KURL.cpp:552
&gt; &gt; -                strcpy(bufferPos, relStringPos);
&gt; &gt; +                strncpy(bufferPos, relStringPos, parserBufferSize - (bufferPosStart - bufferPos));
&gt; 
&gt; This looks backwards, shouldn&apos;t it be (bufferPos - bufferPosStart)?

Yes!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>499083</commentid>
    <comment_count>9</comment_count>
      <attachid>114291</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-11-09 09:48:53 -0800</bug_when>
    <thetext>Comment on attachment 114291
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=114291&amp;action=review

&gt; Source/WebCore/platform/KURL.cpp:485
&gt; +                const size_t parserBufferSize = base.m_pathEnd + 1 + len + 1;

We don’t normally use const like this for local variables. If we did, then bufferPosStart would also be const: const char* bufferPosStart. I suggest just leaving out the const.

&gt; Source/WebCore/platform/KURL.cpp:489
&gt; +                const char* bufferPosStart = bufferPos;

I think bufferStart is the right name for this, not bufferPosStart.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500496</commentid>
    <comment_count>10</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-10 21:07:37 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; (From update of attachment 114291 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=114291&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/platform/KURL.cpp:485
&gt; &gt; +                const size_t parserBufferSize = base.m_pathEnd + 1 + len + 1;
&gt; 
&gt; We don’t normally use const like this for local variables. If we did, then bufferPosStart would also be const: const char* bufferPosStart. I suggest just leaving out the const.

Note that bufferPosStart is also const.

Why do we normally leave out const?  It&apos;s a hint that this value should never be altered within the method, which is exactly what I want.

&gt; &gt; Source/WebCore/platform/KURL.cpp:489
&gt; &gt; +                const char* bufferPosStart = bufferPos;
&gt; 
&gt; I think bufferStart is the right name for this, not bufferPosStart.

Okay.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500500</commentid>
    <comment_count>11</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-10 21:17:04 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; (From update of attachment 114291 [details] [details])
&gt; &gt; View in context: https://bugs.webkit.org/attachment.cgi?id=114291&amp;action=review
&gt; &gt; 
&gt; &gt; &gt; Source/WebCore/platform/KURL.cpp:485
&gt; &gt; &gt; +                const size_t parserBufferSize = base.m_pathEnd + 1 + len + 1;
&gt; &gt; 
&gt; &gt; We don’t normally use const like this for local variables. If we did, then bufferPosStart would also be const: const char* bufferPosStart. I suggest just leaving out the const.
&gt; 
&gt; Why do we normally leave out const?  It&apos;s a hint that this value should never be altered within the method, which is exactly what I want.

Or to put it another way: If someone came along later and added code that changed parserBufferSize/bufferSize between the time it was declared and the time it was used in strncpy(), that should be an error.  Removing the const-ness from the local variable would eliminate this error condition.  The same goes for bufferPosStart/bufferStart, which is why it was also made const.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500502</commentid>
    <comment_count>12</comment_count>
      <attachid>114622</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-10 21:18:43 -0800</bug_when>
    <thetext>Created attachment 114622
Patch v3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500967</commentid>
    <comment_count>13</comment_count>
      <attachid>114622</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-11-11 11:33:11 -0800</bug_when>
    <thetext>Comment on attachment 114622
Patch v3

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500981</commentid>
    <comment_count>14</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-11 11:46:57 -0800</bug_when>
    <thetext>Committed r99999: &lt;http://trac.webkit.org/changeset/99999&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500986</commentid>
    <comment_count>15</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-11 11:55:37 -0800</bug_when>
    <thetext>&lt;rdar://problem/6138531&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>500987</commentid>
    <comment_count>16</comment_count>
      <attachid>114622</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-11 11:56:02 -0800</bug_when>
    <thetext>Comment on attachment 114622
Patch v3

Clearing cq flag as this was landed manually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>502176</commentid>
    <comment_count>17</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-11-14 12:21:31 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #10)
&gt; &gt; (In reply to comment #9)
&gt; &gt; &gt; (From update of attachment 114291 [details] [details] [details])
&gt; &gt; &gt; View in context: https://bugs.webkit.org/attachment.cgi?id=114291&amp;action=review
&gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Source/WebCore/platform/KURL.cpp:485
&gt; &gt; &gt; &gt; +                const size_t parserBufferSize = base.m_pathEnd + 1 + len + 1;
&gt; &gt; &gt; 
&gt; &gt; &gt; We don’t normally use const like this for local variables. If we did, then bufferPosStart would also be const: const char* bufferPosStart. I suggest just leaving out the const.
&gt; &gt; 
&gt; &gt; Why do we normally leave out const?  It&apos;s a hint that this value should never be altered within the method, which is exactly what I want.
&gt; 
&gt; Or to put it another way: If someone came along later and added code that changed parserBufferSize/bufferSize between the time it was declared and the time it was used in strncpy(), that should be an error.  Removing the const-ness from the local variable would eliminate this error condition.  The same goes for bufferPosStart/bufferStart, which is why it was also made const.

bufferStart was not made const. The characters it points to are const, but not the pointer. To make the pointer const you would need to write:

    const char* const bufferStart = bufferPos;

The majority of local variables are intended not to be modified after initialized. Yet we in the past we did not choose to put const in the code in all those places. We can head in a new direction, but typically I prefer to do that after a discussion with WebKit as a group, not in a single patch without that discussion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>502905</commentid>
    <comment_count>18</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-11-15 07:57:18 -0800</bug_when>
    <thetext>(In reply to comment #17)
&gt; bufferStart was not made const. The characters it points to are const, but not the pointer. To make the pointer const you would need to write:
&gt; 
&gt;     const char* const bufferStart = bufferPos;

Sorry, I was thinking about C-const-ness instead of C++-const-ness when writing this.

&gt; The majority of local variables are intended not to be modified after initialized. Yet we in the past we did not choose to put const in the code in all those places. We can head in a new direction, but typically I prefer to do that after a discussion with WebKit as a group, not in a single patch without that discussion.

Filed Bug 72387.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>503017</commentid>
    <comment_count>19</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-11-15 10:21:19 -0800</bug_when>
    <thetext>(In reply to comment #17)
&gt; The majority of local variables are intended not to be modified after initialized. Yet we in the past we did not choose to put const in the code in all those places. We can head in a new direction, but typically I prefer to do that after a discussion with WebKit as a group, not in a single patch without that discussion.

That sounds bit dogmatic. I think the test should be whether using const in a particular case clarifies the code or usefully protects against a class of bugs. Do we really need a project-wide direction for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>503027</commentid>
    <comment_count>20</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-11-15 10:25:32 -0800</bug_when>
    <thetext>(In reply to comment #19)
&gt; I think the test should be whether using const in a particular case clarifies the code or usefully protects against a class of bugs.

Sure, lets look at an example if you think there is a case like that. I don’t think there are any. I’ve never seen a const local variable protect against a class of bugs. Or to put it another way, I’ve never fixed a bug and thought “that never would have happened if this local variable was const”.

&gt; Do we really need a project-wide direction for this?

I think we do. It’s confusing to see const in one case and not see it in another nearly identical case while looking at multiple functions doing similar things. It’s similar to other seemingly trivial style decisions in that consistency makes it easier to concentrate on meaningful differences in the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>503089</commentid>
    <comment_count>21</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-11-15 11:22:20 -0800</bug_when>
    <thetext>(In reply to comment #20)
&gt; (In reply to comment #19)
&gt; &gt; I think the test should be whether using const in a particular case clarifies the code or usefully protects against a class of bugs.
&gt; 
&gt; Sure, lets look at an example if you think there is a case like that. I don’t think there are any. I’ve never seen a const local variable protect against a class of bugs. Or to put it another way, I’ve never fixed a bug and thought “that never would have happened if this local variable was const”.

I think any code that uses more than a few variables of the same type would benefit from marking the ones that are logically constant (start/end pointers and similar) as const to document the intentions.

For example the code discussed in this bug would benefit from making bufferStart, baseString and possibly some others const. Currently it is quite non-obvious which of the many variables the code is actually supposed to be modifying. This is the &quot;clarifies the code&quot; case which I think is not uncommon.

It will also make the compiler warn if you violate these intentions (and at least make you think if they need to be changed). For example modifying bufferStart/bufferSize over the course of this algorithm would be a bug.

If the code in question calls functions that return values in arguments accidental modification may be particularly hard to see. I didn&apos;t search for a good example in WebKit, don&apos;t know if it exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>503095</commentid>
    <comment_count>22</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-11-15 11:33:58 -0800</bug_when>
    <thetext>(In reply to comment #21)
&gt; I think any code that uses more than a few variables of the same type would benefit from marking the ones that are logically constant (start/end pointers and similar) as const to document the intentions.

OK.

&gt; It will also make the compiler warn if you violate these intentions (and at least make you think if they need to be changed). For example modifying bufferStart/bufferSize over the course of this algorithm would be a bug.

I don’t think this has happened in practice, although I could be wrong.

&gt; If the code in question calls functions that return values in arguments accidental modification may be particularly hard to see. I didn&apos;t search for a good example in WebKit, don&apos;t know if it exist.

Pretty sure it does not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>503119</commentid>
    <comment_count>23</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-11-15 11:56:43 -0800</bug_when>
    <thetext>(In reply to comment #22)
&gt; I don’t think this has happened in practice, although I could be wrong.

Personally I make errors of all sorts as I write code, occasionally I think from this class too. Testing generally reveals them well before they land to WebKit in any case, but using tools like const might catch some of them early and so speed up the process. It seems strange to require removing them before landing as there is obvious harm (and there is the possible documentation benefit).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>503120</commentid>
    <comment_count>24</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-11-15 11:57:30 -0800</bug_when>
    <thetext>I meant &quot;no obvious harm&quot;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>114288</attachid>
            <date>2011-11-09 08:23:07 -0800</date>
            <delta_ts>2011-11-09 08:38:25 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>20111109082306.patch</filename>
            <type>text/plain</type>
            <size>2162</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTk1NzUKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCBlMmZmYzIwYjIxOWIyYjU1
NDczZWYzMmVhNWQyYWUxNzk0ZTIxN2MzLi44Y2I1NWNlYjBkYWM4ZWNjNTg4NGY2NjNhODMwOWZm
ZmZmMDc0M2I4IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTIgQEAKKzIwMTEtMTEtMDkgIERhdmlk
IEtpbHplciAgPGRka2lsemVyQGFwcGxlLmNvbT4KKworICAgICAgICA8aHR0cDovL3dlYmtpdC5v
cmcvYi9OTk5OTj4gUmVtb3ZlIHVzZSBvZiBzdHJjYXQgaW4gS1VSTAorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogcGxhdGZvcm0vS1VSTC5jcHA6Cisg
ICAgICAgIChXZWJDb3JlOjpLVVJMOjppbml0KTogUmVwb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iPDw8PDwgc3RybmNweSBjYWxsZWQgPj4+Pj5cbiIp
OwogCiAgICAgICAgICAgICAgICAgcGFyc2UocGFyc2VCdWZmZXIuZGF0YSgpLCAwKTsKIAo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>114291</attachid>
            <date>2011-11-09 08:38:46 -0800</date>
            <delta_ts>2011-11-10 21:18:39 -0800</delta_ts>
            <desc>Patch v2</desc>
            <filename>bug-71921-20111109083845.patch</filename>
            <type>text/plain</type>
            <size>2112</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTk1NzUKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCBlMmZmYzIwYjIxOWIyYjU1
NDczZWYzMmVhNWQyYWUxNzk0ZTIxN2MzLi4zMTYxNDYwOTZjMjM1ZTlhOTZmOTVjMTZmZTMyOTVj
NmUxYjIyYzQ4IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTIgQEAKKzIwMTEtMTEtMDkgIERhdmlk
IEtpbHplciAgPGRka2lsemVyQGFwcGxlLmNvbT4KKworICAgICAgICA8aHR0cDovL3dlYmtpdC5v
cmcvYi83MTkyMT4gUmVtb3ZlIHVzZSBvZiBzdHJjYXQgaW4gS1VSTAorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogcGxhdGZvcm0vS1VSTC5jcHA6Cisg
ICAgICAgIChXZWJDb3JlOjpLVVJMOjppbml0KTogUmVwbGFjZSBzdHJjYXQoKSB3aXRoIHN0cm5j
YXQoKS4KKwogMjAxMS0xMS0wOCAgQW5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XNlLm1fcGF0aEVuZCArIDEgKyBsZW4gKyAxOworICAgICAgICAgICAgICAgIHBhcnNl
QnVmZmVyLnJlc2l6ZShwYXJzZXJCdWZmZXJTaXplKTsKIAogICAgICAgICAgICAgICAgIGNoYXIq
IGJ1ZmZlclBvcyA9IHBhcnNlQnVmZmVyLmRhdGEoKTsKKyAgICAgICAgICAgICAgICBjb25zdCBj
aGFyKiBidWZmZXJQb3NTdGFydCA9IGJ1ZmZlclBvczsKIAogICAgICAgICAgICAgICAgIC8vIGZp
cnN0IGNvcHkgZXZlcnl0aGluZyBiZWZvcmUgdGhlIHBhdGggZnJvbSB0aGUgYmFzZQogICAgICAg
ICAgICAgICAgIHVuc2lnbmVkIGJhc2VMZW5ndGggPSBiYXNlLm1fc3RyaW5nLmxlbmd0aCgpOwpA
QCAtNTQ3LDcgKzU0OSw3IEBAIHZvaWQgS1VSTDo6aW5pdChjb25zdCBLVVJMJiBiYXNlLCBjb25z
dCBTdHJpbmcmIHJlbGF0aXZlLCBjb25zdCBUZXh0RW5jb2RpbmcmIGVuCiAKICAgICAgICAgICAg
ICAgICAvLyBhbGwgZG9uZSB3aXRoIHRoZSBwYXRoIHdvcmssIG5vdyBjb3B5IGFueSByZW1haW5k
ZXIKICAgICAgICAgICAgICAgICAvLyBvZiB0aGUgcmVsYXRpdmUgcmVmZXJlbmNlOyB0aGlzIHdp
bGwgYWxzbyBhZGQgYSBudWxsIHRlcm1pbmF0b3IKLSAgICAgICAgICAgICAgICBzdHJjcHkoYnVm
ZmVyUG9zLCByZWxTdHJpbmdQb3MpOworICAgICAgICAgICAgICAgIHN0cm5jcHkoYnVmZmVyUG9z
LCByZWxTdHJpbmdQb3MsIHBhcnNlckJ1ZmZlclNpemUgLSAoYnVmZmVyUG9zU3RhcnQgLSBidWZm
ZXJQb3MpKTsKIAogICAgICAgICAgICAgICAgIHBhcnNlKHBhcnNlQnVmZmVyLmRhdGEoKSwgMCk7
CiAK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>114622</attachid>
            <date>2011-11-10 21:18:43 -0800</date>
            <delta_ts>2011-11-11 11:56:02 -0800</delta_ts>
            <desc>Patch v3</desc>
            <filename>bug-71921-20111110211842.patch</filename>
            <type>text/plain</type>
            <size>2037</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTk5MDcKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCBlMGYxMWNkZDRlNzQyOGEx
NGY5NzM5N2EwZjJhOTIyZjM0M2Y3YTZkLi5iZjI0NzE3NDdkMDM1MzA5ZTlkNjYwMGJkNzNmZjY0
ODFlNTk2MWE2IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTIgQEAKKzIwMTEtMTEtMTAgIERhdmlk
IEtpbHplciAgPGRka2lsemVyQGFwcGxlLmNvbT4KKworICAgICAgICA8aHR0cDovL3dlYmtpdC5v
cmcvYi83MTkyMT4gUmVtb3ZlIHVzZSBvZiBzdHJjcHkgaW4gS1VSTAorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogcGxhdGZvcm0vS1VSTC5jcHA6Cisg
ICAgICAgIChXZWJDb3JlOjpLVVJMOjppbml0KTogUmVwbGFjZSBzdHJjcHkoKSB3aXRoIHN0cm5j
cHkoKS4KKwogMjAxMS0xMS0xMCAgRGVhbiBKYWNrc29uICA8ZGlub0BhcHBsZS5jb20+CiAKICAg
ICAgICAgUmVtb3ZlIGVmZmVjdEJvdW5kaW5nQm94TW9kZSBmcm9tIENTUyBGaWx0ZXJzCmRpZmYg
LS1naXQgYS9Tb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dGFydCA9IGJ1ZmZlclBvczsKIAogICAgICAgICAgICAgICAgIC8vIGZpcnN0IGNvcHkg
ZXZlcnl0aGluZyBiZWZvcmUgdGhlIHBhdGggZnJvbSB0aGUgYmFzZQogICAgICAgICAgICAgICAg
IHVuc2lnbmVkIGJhc2VMZW5ndGggPSBiYXNlLm1fc3RyaW5nLmxlbmd0aCgpOwpAQCAtNTQ3LDcg
KzU0OSw3IEBAIHZvaWQgS1VSTDo6aW5pdChjb25zdCBLVVJMJiBiYXNlLCBjb25zdCBTdHJpbmcm
IHJlbGF0aXZlLCBjb25zdCBUZXh0RW5jb2RpbmcmIGVuCiAKICAgICAgICAgICAgICAgICAvLyBh
bGwgZG9uZSB3aXRoIHRoZSBwYXRoIHdvcmssIG5vdyBjb3B5IGFueSByZW1haW5kZXIKICAgICAg
ICAgICAgICAgICAvLyBvZiB0aGUgcmVsYXRpdmUgcmVmZXJlbmNlOyB0aGlzIHdpbGwgYWxzbyBh
ZGQgYSBudWxsIHRlcm1pbmF0b3IKLSAgICAgICAgICAgICAgICBzdHJjcHkoYnVmZmVyUG9zLCBy
ZWxTdHJpbmdQb3MpOworICAgICAgICAgICAgICAgIHN0cm5jcHkoYnVmZmVyUG9zLCByZWxTdHJp
bmdQb3MsIGJ1ZmZlclNpemUgLSAoYnVmZmVyUG9zIC0gYnVmZmVyU3RhcnQpKTsKIAogICAgICAg
ICAgICAgICAgIHBhcnNlKHBhcnNlQnVmZmVyLmRhdGEoKSwgMCk7CiAK
</data>
<flag name="review"
          id="113323"
          type_id="1"
          status="+"
          setter="koivisto"
    />
          </attachment>
      

    </bug>

</bugzilla>