Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Development (http://www.linux-archive.org/ubuntu-development/)
-   -   Avoid SIGSEGV in doPwMount() when NULL is last parameter (#491192) (http://www.linux-archive.org/ubuntu-development/266669-avoid-sigsegv-dopwmount-when-null-last-parameter-491192-a.html)

David Lehman 03-20-2009 03:31 AM

Avoid SIGSEGV in doPwMount() when NULL is last parameter (#491192)
 
On Thu, 2009-03-19 at 18:17 -1000, David Cantrell wrote:
> If NULL is given as the last parameter to doPwMount(), do not try
> to dereference it.

Looks good.

> ---
> isys/imount.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/isys/imount.c b/isys/imount.c
> index 614e67e..fd51fde 100644
> --- a/isys/imount.c
> +++ b/isys/imount.c
> @@ -146,9 +146,11 @@ int doPwMount(char *dev, char *where, char *fs, char *options, char **err) {
>
> close(pipefd[1]);
>
> - if (*err != NULL) {
> - rc = readFD(pipefd[0], err);
> - rc = write(programLogFD, *err, 4096);
> + if (err != NULL) {
> + if (*err != NULL) {
> + rc = readFD(pipefd[0], err);
> + rc = write(programLogFD, *err, 4096);
> + }
> }
>
> close(pipefd[0]);

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

David Cantrell 03-20-2009 03:57 AM

Avoid SIGSEGV in doPwMount() when NULL is last parameter (#491192)
 
On 03/19/2009 06:31 PM, David Lehman wrote:

On Thu, 2009-03-19 at 18:17 -1000, David Cantrell wrote:

If NULL is given as the last parameter to doPwMount(), do not try
to dereference it.


Looks good.


Applied and pushed, thanks.




---
isys/imount.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/isys/imount.c b/isys/imount.c
index 614e67e..fd51fde 100644
--- a/isys/imount.c
+++ b/isys/imount.c
@@ -146,9 +146,11 @@ int doPwMount(char *dev, char *where, char *fs, char *options, char **err) {

close(pipefd[1]);

- if (*err != NULL) {
- rc = readFD(pipefd[0], err);
- rc = write(programLogFD, *err, 4096);
+ if (err != NULL) {
+ if (*err != NULL) {
+ rc = readFD(pipefd[0], err);
+ rc = write(programLogFD, *err, 4096);
+ }
}

close(pipefd[0]);


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list



--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 07:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.