lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-Id: <200710090125.19089.rob@landley.net> Date: Tue, 9 Oct 2007 01:25:18 -0500 From: Rob Landley <rob@...dley.net> To: akpm@...ux-foundation.org Cc: linux-kernel@...r.kernel.org, rdunlap@...otime.net Subject: [PATCH] Stop docproc segfaulting when SRCTREE isn't set. From: Rob Landley <rob@...dley.net> Prevent docproc from segfaulting when SRCTREE isn't set. Signed-off-by: Rob Landley <rob@...dley.net> --- scripts/basic/docproc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff -r a26a53ed1101 scripts/basic/docproc.c --- a/scripts/basic/docproc.c Sun Oct 07 16:42:22 2007 -0700 +++ b/scripts/basic/docproc.c Tue Oct 09 01:08:54 2007 -0500 @@ -64,12 +64,15 @@ FILELINE * entity_system; #define FUNCTION "-function" #define NOFUNCTION "-nofunction" +char *srctree; + void usage (void) { fprintf(stderr, "Usage: docproc {doc|depend} file\n"); fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); fprintf(stderr, "doc: frontend when generating kernel documentation\n"); fprintf(stderr, "depend: generate list of files referenced within file\n"); + fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n"); } /* @@ -88,7 +91,7 @@ void exec_kernel_doc(char **svec) exit(1); case 0: memset(real_filename, 0, sizeof(real_filename)); - strncat(real_filename, getenv("SRCTREE"), PATH_MAX); + strncat(real_filename, srctree, PATH_MAX); strncat(real_filename, KERNELDOCPATH KERNELDOC, PATH_MAX - strlen(real_filename)); execvp(real_filename, svec); @@ -168,7 +171,7 @@ void find_export_symbols(char * filename if (filename_exist(filename) == NULL) { char real_filename[PATH_MAX + 1]; memset(real_filename, 0, sizeof(real_filename)); - strncat(real_filename, getenv("SRCTREE"), PATH_MAX); + strncat(real_filename, srctree, PATH_MAX); strncat(real_filename, filename, PATH_MAX - strlen(real_filename)); sym = add_new_file(filename); @@ -335,6 +338,9 @@ int main(int argc, char *argv[]) int main(int argc, char *argv[]) { FILE * infile; + + srctree = getenv("SRCTREE"); + if (!srctree) srctree = getcwd(NULL,0); if (argc != 3) { usage(); exit(1); -- "One of my most productive days was throwing away 1000 lines of code." - Ken Thompson. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists