diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-02-26 01:22:36 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-02-26 01:22:36 +0000 |
commit | 81e7a2bf27dae8864d1433198dcdcfe0b797f3d2 (patch) | |
tree | 9eb8277401600c4e95b629a7f87f382e3f9d4f8a /mdk-stage1 | |
parent | 45ec1542b40228bf9dd35c13a6fd1fa55e842d57 (diff) | |
download | drakx-backup-do-not-use-81e7a2bf27dae8864d1433198dcdcfe0b797f3d2.tar drakx-backup-do-not-use-81e7a2bf27dae8864d1433198dcdcfe0b797f3d2.tar.gz drakx-backup-do-not-use-81e7a2bf27dae8864d1433198dcdcfe0b797f3d2.tar.bz2 drakx-backup-do-not-use-81e7a2bf27dae8864d1433198dcdcfe0b797f3d2.tar.xz drakx-backup-do-not-use-81e7a2bf27dae8864d1433198dcdcfe0b797f3d2.zip |
(try_with_device) fix segfaulting when ISO directory is not valid (mga#4592)
(use our new non segfaulting dirname() implementation)
also do not include string.h twice
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/NEWS | 2 | ||||
-rw-r--r-- | mdk-stage1/disk.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS index d59deb366..01da0f0ec 100644 --- a/mdk-stage1/NEWS +++ b/mdk-stage1/NEWS @@ -1,3 +1,5 @@ +- fix segfaulting when ISO directory is not valid (mga#4592) + 1.61 - fix building with newer dietlibc/zlib diff --git a/mdk-stage1/disk.c b/mdk-stage1/disk.c index c2b71dbfc..804c8ea2b 100644 --- a/mdk-stage1/disk.c +++ b/mdk-stage1/disk.c @@ -19,14 +19,14 @@ * */ +#define _GNU_SOURCE /* We want the non segfaulting my_dirname() -- See dirname(3) */ +#include <string.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> -#include <string.h> #include <sys/mount.h> #include <sys/stat.h> #include <fcntl.h> -#include <string.h> #include <libgen.h> #include "stage1.h" #include "frontend.h" @@ -155,7 +155,7 @@ static enum return_type try_with_device(char *dev_name) char * path = strdup(answers_location[0]); stg1_error_message("Directory or ISO image file could not be found on partition.\n" "Here's a short extract of the files in the directory %s:\n" - "%s", dirname(path), extract_list_directory(dirname(location_full))); + "%s", my_dirname(path), extract_list_directory(my_dirname(location_full))); free(path); goto ask_dir; } |