<?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>145596</bug_id>
          
          <creation_ts>2015-06-02 23:08:25 -0700</creation_ts>
          <short_desc>[EFL][GTK] Fix build error since r185137</short_desc>
          <delta_ts>2015-06-03 17:15:56 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=145608</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>145283</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hyungwook Lee">hyungwook.lee</reporter>
          <assigned_to name="Gyuyoung Kim">gyuyoung.kim</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>d_russell</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>kangil.han</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1099078</commentid>
    <comment_count>0</comment_count>
    <who name="Hyungwook Lee">hyungwook.lee</who>
    <bug_when>2015-06-02 23:08:25 -0700</bug_when>
    <thetext>r185137 used strlcpy() even though it is not standardized by POSIX. It caused build break on GTK and EFL port&apos;s debug build. To fix it, let&apos;s use strncpy() in Text.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099079</commentid>
    <comment_count>1</comment_count>
      <attachid>254154</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2015-06-02 23:10:25 -0700</bug_when>
    <thetext>Created attachment 254154
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099083</commentid>
    <comment_count>2</comment_count>
      <attachid>254154</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-06-02 23:13:35 -0700</bug_when>
    <thetext>Comment on attachment 254154
Patch

Rejecting attachment 254154 from commit-queue.

hyungwook.lee@navercorp.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099086</commentid>
    <comment_count>3</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2015-06-02 23:17:44 -0700</bug_when>
    <thetext>I uploaded this patch instead of Hyungwook.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099104</commentid>
    <comment_count>4</comment_count>
      <attachid>254154</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2015-06-02 23:59:10 -0700</bug_when>
    <thetext>Comment on attachment 254154
Patch

Clearing flags on attachment: 254154

Committed r185148: &lt;http://trac.webkit.org/changeset/185148&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099105</commentid>
    <comment_count>5</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2015-06-02 23:59:17 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099149</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2015-06-03 08:05:59 -0700</bug_when>
    <thetext>I think this is a buffer overflow; it should be strncpy(buffer, result.toString().utf8().data(), length - 1) as it was prior to r185137.

From strcpy(3):

   strlcpy()
       Some  systems  (the  BSDs,  Solaris,  and others) provide the following
       function:

           size_t strlcpy(char *dest, const char *src, size_t size);

       This function is similar to strncpy(), but it  copies  at  most  size-1
       bytes  to  dest,  always adds a terminating null byte, and does not pad
       the target with (further) null bytes.  This function fixes some of  the
       problems  of  strcpy()  and strncpy(), but the caller must still handle
       the possibility of data loss if size is too small.  The return value of
       the function is the length of src, which allows truncation to be easily
       detected: if the return value is greater than or equal to size, trunca‐
       tion  occurred.   If loss of data matters, the caller must either check
       the arguments before the call,  or  test  the  function  return  value.
       strlcpy() is not present in glibc and is not standardized by POSIX, but
       is available on Linux via the libbsd library.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099176</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2015-06-03 09:59:07 -0700</bug_when>
    <thetext>Let&apos;s use bug #145608</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1099327</commentid>
    <comment_count>8</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2015-06-03 17:15:56 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; I think this is a buffer overflow; it should be strncpy(buffer,
&gt; result.toString().utf8().data(), length - 1) as it was prior to r185137.
&gt; 
&gt; From strcpy(3):
&gt; 
&gt;    strlcpy()
&gt;        Some  systems  (the  BSDs,  Solaris,  and others) provide the
&gt; following
&gt;        function:
&gt; 
&gt;            size_t strlcpy(char *dest, const char *src, size_t size);
&gt; 
&gt;        This function is similar to strncpy(), but it  copies  at  most 
&gt; size-1
&gt;        bytes  to  dest,  always adds a terminating null byte, and does not
&gt; pad
&gt;        the target with (further) null bytes.  This function fixes some of 
&gt; the
&gt;        problems  of  strcpy()  and strncpy(), but the caller must still
&gt; handle
&gt;        the possibility of data loss if size is too small.  The return value
&gt; of
&gt;        the function is the length of src, which allows truncation to be
&gt; easily
&gt;        detected: if the return value is greater than or equal to size,
&gt; trunca‐
&gt;        tion  occurred.   If loss of data matters, the caller must either
&gt; check
&gt;        the arguments before the call,  or  test  the  function  return 
&gt; value.
&gt;        strlcpy() is not present in glibc and is not standardized by POSIX,
&gt; but
&gt;        is available on Linux via the libbsd library.

Oh, thank you for your fix.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>254154</attachid>
            <date>2015-06-02 23:10:25 -0700</date>
            <delta_ts>2015-06-02 23:59:10 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-145596-20150603151005.patch</filename>
            <type>text/plain</type>
            <size>1199</size>
            <attacher name="Gyuyoung Kim">gyuyoung.kim</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTg1MTM3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggY2E0YWMzMWUyZDE2YWVi
MGUxOGMwZDYwMzVlZWZjYTBhOTI3MTc1Zi4uMDJmMjAzY2I0MTNjMzMzOTk0MmRjMmQyMDJmYzNm
OTBkNTE2YjE4ZSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDEzIEBACisyMDE1LTA2LTAyICBHeXV5
b3VuZyBLaW0gIDxneXV5b3VuZy5raW1Ad2Via2l0Lm9yZz4KKworICAgICAgICBbRUZMXVtHVEtd
IEZpeCBidWlsZCBlcnJvciBzaW5jZSByMTg1MTM3CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3Jn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