Patchwork [google,gcc-4_7] Backport r195207 (fix for PR55982) into google/gcc-4_7

login
register
mail settings
Submitter Paul Pluzhnikov
Date Jan. 15, 2013, 6:42 p.m.
Message ID <ye6qmwwa1e6b.fsf@elbrus2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/212294/
State New
Headers show

Comments

Paul Pluzhnikov - Jan. 15, 2013, 6:42 p.m.
Ok for google/gcc-4_7 ?

Ref b/8003094

Thanks,
--
Paul Pluzhnikov


2013-01-15  Paul Pluzhnikov  <ppluzhnikov@google.com>

	PR 55982
	* strncat-chk.c (__strncat_chk): Fix loop unroll.
Diego Novillo - Jan. 15, 2013, 6:46 p.m.
On Tue, Jan 15, 2013 at 1:42 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> Ok for google/gcc-4_7 ?
>
> Ref b/8003094
>
> Thanks,
> --
> Paul Pluzhnikov
>
>
> 2013-01-15  Paul Pluzhnikov  <ppluzhnikov@google.com>
>
>         PR 55982
>         * strncat-chk.c (__strncat_chk): Fix loop unroll.
>
>
> Index: libssp/strncat-chk.c
> ===================================================================
> --- libssp/strncat-chk.c        (revision 195212)
> +++ libssp/strncat-chk.c        (working copy)
> @@ -87,12 +87,6 @@ __strncat_chk (char *__restrict__ dest, const char
>            *++dest = c;
>            if (c == '\0')
>              return s;
> -          if (slen-- == 0)
> -            __chk_fail ();
> -          c = *src++;
> -          *++dest = c;
> -          if (c == '\0')
> -            return s;
>          } while (--n4 > 0);
>        n &= 3;
>      }

OK.  No need to add a ChangeLog entry.  Simply put your message in the
commit log entry.


Diego.

Patch

Index: libssp/strncat-chk.c
===================================================================
--- libssp/strncat-chk.c	(revision 195212)
+++ libssp/strncat-chk.c	(working copy)
@@ -87,12 +87,6 @@  __strncat_chk (char *__restrict__ dest, const char
           *++dest = c;
           if (c == '\0')
             return s;
-          if (slen-- == 0)
-            __chk_fail ();
-          c = *src++;
-          *++dest = c;
-          if (c == '\0')
-            return s;
         } while (--n4 > 0);
       n &= 3;
     }