public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: off-by-one buffer overflow patch
@ 2021-03-26 17:38 dhumieres.dominique
  2021-03-27  5:36 ` Jerry DeLisle
  0 siblings, 1 reply; 6+ messages in thread
From: dhumieres.dominique @ 2021-03-26 17:38 UTC (permalink / raw)
  To: sgk; +Cc: fortran

I have proposed a similar patch in pr95998.

I cannot commit to git!-(

Thanks

Dominique

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: off-by-one buffer overflow patch
  2021-03-26 17:38 off-by-one buffer overflow patch dhumieres.dominique
@ 2021-03-27  5:36 ` Jerry DeLisle
  2021-03-27 13:28   ` dhumieres.dominique
  0 siblings, 1 reply; 6+ messages in thread
From: Jerry DeLisle @ 2021-03-27  5:36 UTC (permalink / raw)
  To: dhumieres.dominique, sgk; +Cc: fortran

On 3/26/21 10:38 AM, dhumieres.dominique--- via Fortran wrote:
> I have proposed a similar patch in pr95998.
>
> I cannot commit to git!-(
>
> Thanks
>
> Dominique
I do not see a patch in 95998.  Do you need help to do a commit?

Jerry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: off-by-one buffer overflow patch
  2021-03-27  5:36 ` Jerry DeLisle
@ 2021-03-27 13:28   ` dhumieres.dominique
  2021-03-27 22:11     ` Jerry DeLisle
  0 siblings, 1 reply; 6+ messages in thread
From: dhumieres.dominique @ 2021-03-27 13:28 UTC (permalink / raw)
  To: Jerry DeLisle; +Cc: sgk, fortran

Le 2021-03-27 06:36, Jerry DeLisle a écrit :
> On 3/26/21 10:38 AM, dhumieres.dominique--- via Fortran wrote:
>> I have proposed a similar patch in pr95998.
>> 
>> I cannot commit to git!-(
>> 
>> Thanks
>> 
>> Dominique
> I do not see a patch in 95998.  Do you need help to do a commit?
> 
> Jerry

I was too quick and did not realize that I did not post the actual patch
I have in my working tree, but the Steve's one does the trick.

And yes I need help to do a commit.

Thanks

Dominique

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: off-by-one buffer overflow patch
  2021-03-27 13:28   ` dhumieres.dominique
@ 2021-03-27 22:11     ` Jerry DeLisle
  2021-03-27 23:49       ` Steve Kargl
  0 siblings, 1 reply; 6+ messages in thread
From: Jerry DeLisle @ 2021-03-27 22:11 UTC (permalink / raw)
  To: dhumieres.dominique; +Cc: sgk, fortran, gcc-patches

Pushed:

To git+ssh://gcc.gnu.org/git/gcc.git
    651684b462f..01685676a93  master -> master

Author: Steve Kargl <kargl@gcc.gnu.org>
Date:   Sat Mar 27 15:02:16 2021 -0700

     fortran: Fix off-by-one in buffer sizes.

     gcc/fortran/ChangeLog:

             * misc.c (gfc_typename): Fix off-by-one in buffer sizes.

Regards,

Jerry

On 3/27/21 6:28 AM, dhumieres.dominique@free.fr wrote:
> Le 2021-03-27 06:36, Jerry DeLisle a écrit :
>> On 3/26/21 10:38 AM, dhumieres.dominique--- via Fortran wrote:
>>> I have proposed a similar patch in pr95998.
>>>
>>> I cannot commit to git!-(
>>>
>>> Thanks
>>>
>>> Dominique
>> I do not see a patch in 95998.  Do you need help to do a commit?
>>
>> Jerry
>
> I was too quick and did not realize that I did not post the actual patch
> I have in my working tree, but the Steve's one does the trick.
>
> And yes I need help to do a commit.
>
> Thanks
>
> Dominique


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: off-by-one buffer overflow patch
  2021-03-27 22:11     ` Jerry DeLisle
@ 2021-03-27 23:49       ` Steve Kargl
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Kargl @ 2021-03-27 23:49 UTC (permalink / raw)
  To: Jerry DeLisle; +Cc: dhumieres.dominique, fortran, gcc-patches


On Sat, Mar 27, 2021 at 03:11:05PM -0700, Jerry DeLisle wrote:
> Pushed:
> 
> To git+ssh://gcc.gnu.org/git/gcc.git
>    651684b462f..01685676a93  master -> master
> 
> Author: Steve Kargl <kargl@gcc.gnu.org>
> Date:   Sat Mar 27 15:02:16 2021 -0700
> 
>     fortran: Fix off-by-one in buffer sizes.
> 
>     gcc/fortran/ChangeLog:
> 
>             * misc.c (gfc_typename): Fix off-by-one in buffer sizes.
> 
> Regards,
> 
> Jerry

Thanks for committing the patch.

-- 
steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* off-by-one buffer overflow patch
@ 2021-03-26 17:29 Steve Kargl
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Kargl @ 2021-03-26 17:29 UTC (permalink / raw)
  To: fortran, gcc-patches

This patch fixes an off-by-one buffer overflow issue.
Please commit.


diff --git a/gcc/fortran/misc.c b/gcc/fortran/misc.c
index 8a96243e80d..3d449ae17fe 100644
--- a/gcc/fortran/misc.c
+++ b/gcc/fortran/misc.c
@@ -124,8 +124,10 @@ gfc_basic_typename (bt type)
 const char *
 gfc_typename (gfc_typespec *ts, bool for_hash)
 {
-  static char buffer1[GFC_MAX_SYMBOL_LEN + 7];  /* 7 for "TYPE()" + '\0'.  */
-  static char buffer2[GFC_MAX_SYMBOL_LEN + 7];
+  /* Need to add sufficient padding for "TYPE()" + '\0', "UNION()" + '\0',
+     or "CLASS()" + '\0'.  */
+  static char buffer1[GFC_MAX_SYMBOL_LEN + 8];
+  static char buffer2[GFC_MAX_SYMBOL_LEN + 8];
   static int flag = 0;
   char *buffer;
   gfc_typespec *ts1;

-- 
Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-27 23:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 17:38 off-by-one buffer overflow patch dhumieres.dominique
2021-03-27  5:36 ` Jerry DeLisle
2021-03-27 13:28   ` dhumieres.dominique
2021-03-27 22:11     ` Jerry DeLisle
2021-03-27 23:49       ` Steve Kargl
  -- strict thread matches above, loose matches on Subject: below --
2021-03-26 17:29 Steve Kargl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).