FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-05-2011, 09:35 PM
Florian Pritz
 
Default fix segfault if pacman.conf can't be read

Signed-off-by: Florian Pritz <bluewind@xinu.at>
---
src/pacman/conf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 3af3fa5..b724ae3 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -750,7 +750,7 @@ static int _parseconfig(const char *file, struct section_t *section,
}

cleanup:
- fclose(fp);
+ if (fp) fclose(fp);
pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s
", file);
return ret;
}
--
1.7.6
 
Old 07-05-2011, 09:39 PM
Dan McGee
 
Default fix segfault if pacman.conf can't be read

On Tue, Jul 5, 2011 at 4:35 PM, Florian Pritz <bluewind@xinu.at> wrote:
> Signed-off-by: Florian Pritz <bluewind@xinu.at>
> ---
> *src/pacman/conf.c | * *2 +-
> *1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/pacman/conf.c b/src/pacman/conf.c
> index 3af3fa5..b724ae3 100644
> --- a/src/pacman/conf.c
> +++ b/src/pacman/conf.c
> @@ -750,7 +750,7 @@ static int _parseconfig(const char *file, struct section_t *section,
> * * * *}
>
> *cleanup:
> - * * * fclose(fp);
> + * * * if (fp) fclose(fp);
Please see the style guide in HACKING and resubmit- all conditionals
require {} and and should span multiple lines.

> * * * *pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s
", file);
> * * * *return ret;
> *}
> --
> 1.7.6
>
>
 
Old 07-05-2011, 09:46 PM
Florian Pritz
 
Default fix segfault if pacman.conf can't be read

Signed-off-by: Florian Pritz <bluewind@xinu.at>
---
src/pacman/conf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 3af3fa5..b724ae3 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -750,7 +750,7 @@ static int _parseconfig(const char *file, struct section_t *section,
}

cleanup:
- fclose(fp);
+ if (fp) fclose(fp);
pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s
", file);
return ret;
}
--
1.7.6
 
Old 07-05-2011, 09:47 PM
Florian Pritz
 
Default fix segfault if pacman.conf can't be read

Signed-off-by: Florian Pritz <bluewind@xinu.at>
---
src/pacman/conf.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 3af3fa5..fac6da3 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -750,7 +750,9 @@ static int _parseconfig(const char *file, struct section_t *section,
}

cleanup:
- fclose(fp);
+ if (fp) {
+ fclose(fp);
+ }
pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s
", file);
return ret;
}
--
1.7.6
 

Thread Tools




All times are GMT. The time now is 10:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org