public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elf: Fix uninitialized variable for _dl_write
@ 2020-11-12  9:44 Shuo Wang
  2020-11-12 14:41 ` Adhemerval Zanella
  0 siblings, 1 reply; 4+ messages in thread
From: Shuo Wang @ 2020-11-12  9:44 UTC (permalink / raw)
  To: libc-alpha, adhemerval.zanella; +Cc: Hushiyuan

elf: Fix uninitialized variable for _dl_write

Variable ret in elf/dl-write.c is uninitialized, which should get return value from __writev.
---
 elf/dl-write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/dl-write.c b/elf/dl-write.c
index 7350aff003..9b741c8a8f 100644
--- a/elf/dl-write.c
+++ b/elf/dl-write.c
@@ -41,7 +41,7 @@ _dl_write (int fd, const void *buffer, size_t length)
   else
     {
       __rtld_lock_lock_recursive (GL(dl_load_lock));
-      __writev (fd, &iov, 1);
+      ret = __writev (fd, &iov, 1);
       if (ret < 0)
         ret = -errno;
       __rtld_lock_unlock_recursive (GL(dl_load_lock));
-- 
2.23.0

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

* Re: [PATCH] elf: Fix uninitialized variable for _dl_write
  2020-11-12  9:44 [PATCH] elf: Fix uninitialized variable for _dl_write Shuo Wang
@ 2020-11-12 14:41 ` Adhemerval Zanella
  0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2020-11-12 14:41 UTC (permalink / raw)
  To: Shuo Wang, libc-alpha; +Cc: Hushiyuan



On 12/11/2020 06:44, Shuo Wang wrote:
> elf: Fix uninitialized variable for _dl_write
> 
> Variable ret in elf/dl-write.c is uninitialized, which should get return value from __writev.

LGTM, although it would only impact Hurd.

> ---
>  elf/dl-write.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/elf/dl-write.c b/elf/dl-write.c
> index 7350aff003..9b741c8a8f 100644
> --- a/elf/dl-write.c
> +++ b/elf/dl-write.c
> @@ -41,7 +41,7 @@ _dl_write (int fd, const void *buffer, size_t length)
>    else
>      {
>        __rtld_lock_lock_recursive (GL(dl_load_lock));
> -      __writev (fd, &iov, 1);
> +      ret = __writev (fd, &iov, 1);
>        if (ret < 0)
>          ret = -errno;
>        __rtld_lock_unlock_recursive (GL(dl_load_lock));
> 

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

* Re: [PATCH] elf: Fix uninitialized variable for _dl_write
  2020-11-24  1:51 Shuo Wang
@ 2020-11-24 19:55 ` Adhemerval Zanella
  0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2020-11-24 19:55 UTC (permalink / raw)
  To: Shuo Wang, libc-alpha; +Cc: hushiyuan

Done.

On 23/11/2020 22:51, Shuo Wang wrote:
> 	Dear Adhemerval,
> 	
> I was wondering if this patch will be merged?
> 
> Thank you,
> Shuo
> 
>>> elf: Fix uninitialized variable for _dl_write
>>>
>>> Variable ret in elf/dl-write.c is uninitialized, which should get return value from __writev.
>>
>> LGTM, although it would only impact Hurd.
>>
>>> ---
>>>  elf/dl-write.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/elf/dl-write.c b/elf/dl-write.c
>>> index 7350aff003..9b741c8a8f 100644
>>> --- a/elf/dl-write.c
>>> +++ b/elf/dl-write.c
>>> @@ -41,7 +41,7 @@ _dl_write (int fd, const void *buffer, size_t length)
>>>    else
>>>      {
>>>        __rtld_lock_lock_recursive (GL(dl_load_lock));
>>> -      __writev (fd, &iov, 1);
>>> +      ret = __writev (fd, &iov, 1);
>>>        if (ret < 0)
>>>          ret = -errno;
>>>        __rtld_lock_unlock_recursive (GL(dl_load_lock));
>>>

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

* [PATCH] elf: Fix uninitialized variable for _dl_write
@ 2020-11-24  1:51 Shuo Wang
  2020-11-24 19:55 ` Adhemerval Zanella
  0 siblings, 1 reply; 4+ messages in thread
From: Shuo Wang @ 2020-11-24  1:51 UTC (permalink / raw)
  To: adhemerval.zanella, libc-alpha; +Cc: hushiyuan

	Dear Adhemerval,
	
I was wondering if this patch will be merged?

Thank you,
Shuo

> > elf: Fix uninitialized variable for _dl_write
> > 
> > Variable ret in elf/dl-write.c is uninitialized, which should get return value from __writev.
> 
> LGTM, although it would only impact Hurd.
> 
> > ---
> >  elf/dl-write.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/elf/dl-write.c b/elf/dl-write.c
> > index 7350aff003..9b741c8a8f 100644
> > --- a/elf/dl-write.c
> > +++ b/elf/dl-write.c
> > @@ -41,7 +41,7 @@ _dl_write (int fd, const void *buffer, size_t length)
> >    else
> >      {
> >        __rtld_lock_lock_recursive (GL(dl_load_lock));
> > -      __writev (fd, &iov, 1);
> > +      ret = __writev (fd, &iov, 1);
> >        if (ret < 0)
> >          ret = -errno;
> >        __rtld_lock_unlock_recursive (GL(dl_load_lock));
> > 

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

end of thread, other threads:[~2020-11-24 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12  9:44 [PATCH] elf: Fix uninitialized variable for _dl_write Shuo Wang
2020-11-12 14:41 ` Adhemerval Zanella
2020-11-24  1:51 Shuo Wang
2020-11-24 19:55 ` Adhemerval Zanella

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).