Fri Dec 11 19:23:22 2015 UTC ()
initscr is supposed to return NULL on error. Some versions of ncurses at
least like to play nanny and error out internally, but catch those
errors explicitly. Stops segfault when using NetBSD curses with invalid
TERM settings.


(joerg)
diff -r1.82 -r1.83 pkgsrc/devel/cmake/distinfo
diff -r0 -r1.1 pkgsrc/devel/cmake/patches/patch-Source_CursesDialog_ccmake.cxx

cvs diff -r1.82 -r1.83 pkgsrc/devel/cmake/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/cmake/distinfo 2015/12/07 09:30:32 1.82
+++ pkgsrc/devel/cmake/distinfo 2015/12/11 19:23:22 1.83
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1$NetBSD: distinfo,v 1.82 2015/12/07 09:30:32 adam Exp $ 1$NetBSD: distinfo,v 1.83 2015/12/11 19:23:22 joerg Exp $
2 2
3SHA1 (cmake-3.4.1.tar.gz) = 345258f3fdb8609e5c021c1d70490010ae3cb9bc 3SHA1 (cmake-3.4.1.tar.gz) = 345258f3fdb8609e5c021c1d70490010ae3cb9bc
4RMD160 (cmake-3.4.1.tar.gz) = b50b982f0f60a0f52c70527691a42cd5718b2ceb 4RMD160 (cmake-3.4.1.tar.gz) = b50b982f0f60a0f52c70527691a42cd5718b2ceb
5SHA512 (cmake-3.4.1.tar.gz) = 072bbfc3ffe3a838945ce6e7c4bbce267362673c3b870886accdc5a5ee01dbd071604fca6aa519d077676423d37bfe987b71f22f14a194f8d6ec8fb9de0a6049 5SHA512 (cmake-3.4.1.tar.gz) = 072bbfc3ffe3a838945ce6e7c4bbce267362673c3b870886accdc5a5ee01dbd071604fca6aa519d077676423d37bfe987b71f22f14a194f8d6ec8fb9de0a6049
6Size (cmake-3.4.1.tar.gz) = 6721965 bytes 6Size (cmake-3.4.1.tar.gz) = 6721965 bytes
7SHA1 (patch-CMakeLists.txt) = ae722c41e0d9a1396fe80f1000266a33e406e2f6 7SHA1 (patch-CMakeLists.txt) = ae722c41e0d9a1396fe80f1000266a33e406e2f6
8SHA1 (patch-Modules_FindX11.cmake) = 124a2d51155cb4455e8b829dc74598cbd50a4e1c 8SHA1 (patch-Modules_FindX11.cmake) = 124a2d51155cb4455e8b829dc74598cbd50a4e1c
9SHA1 (patch-Modules_Platform_SCO__SV.cmake) = 3ed230b3a06ea693812db8f57bc73aebec12b99f 9SHA1 (patch-Modules_Platform_SCO__SV.cmake) = 3ed230b3a06ea693812db8f57bc73aebec12b99f
 10SHA1 (patch-Source_CursesDialog_ccmake.cxx) = c77cf55df2b047908178e7ed1db6e5454834ea49
10SHA1 (patch-Source_cmELF.cxx) = 5eb9dc0b3567b5685596ddf0a03ca8e5c76e6f92 11SHA1 (patch-Source_cmELF.cxx) = 5eb9dc0b3567b5685596ddf0a03ca8e5c76e6f92
11SHA1 (patch-Source_kwsys_SystemInformation.cxx) = 5e8c8ff7875c329e48c54ee03570ea4a6d52953a 12SHA1 (patch-Source_kwsys_SystemInformation.cxx) = 5e8c8ff7875c329e48c54ee03570ea4a6d52953a
12SHA1 (patch-Source_kwsys_SystemTools.cxx) = 634348b9bc8ccf8c72f23837baa6ba0bcacf5961 13SHA1 (patch-Source_kwsys_SystemTools.cxx) = 634348b9bc8ccf8c72f23837baa6ba0bcacf5961
13SHA1 (patch-Utilities_KWIML_CMakeLists.txt) = 4e8cef0eab2ad8cb27cd7076e077bb5e7425a95c 14SHA1 (patch-Utilities_KWIML_CMakeLists.txt) = 4e8cef0eab2ad8cb27cd7076e077bb5e7425a95c
14SHA1 (patch-aa) = bab24334e025b7c1bf7caa2e69d6a439cc421ea9 15SHA1 (patch-aa) = bab24334e025b7c1bf7caa2e69d6a439cc421ea9
15SHA1 (patch-ab) = d1b39bdcd654f2a4fc63463cd20de656cce3cf8f 16SHA1 (patch-ab) = d1b39bdcd654f2a4fc63463cd20de656cce3cf8f
16SHA1 (patch-ac) = b5cedc6a2354beaf08e06d416c150154a7dc1f05 17SHA1 (patch-ac) = b5cedc6a2354beaf08e06d416c150154a7dc1f05

File Added: pkgsrc/devel/cmake/patches/Attic/patch-Source_CursesDialog_ccmake.cxx
$NetBSD: patch-Source_CursesDialog_ccmake.cxx,v 1.1 2015/12/11 19:23:22 joerg Exp $

--- Source/CursesDialog/ccmake.cxx.orig	2015-12-02 15:43:21.000000000 +0000
+++ Source/CursesDialog/ccmake.cxx
@@ -68,7 +68,11 @@ void onsig(int)
   if (cmCursesForm::CurrentForm)
     {
     endwin();
-    initscr(); /* Initialization */
+    if (initscr() == NULL) {
+      static const char errmsg[] = "terminal setup failed\n";
+      write(STDERR_FILENO, errmsg, sizeof(errmsg) - 1);
+      exit (1);
+    }
     noecho(); /* Echo off */
     cbreak(); /* nl- or cr not needed */
     keypad(stdscr,TRUE); /* Use key symbols as
@@ -154,7 +158,10 @@ int main(int argc, char const* const* ar
     cmCursesForm::DebugStart();
     }
 
-  initscr(); /* Initialization */
+  if (initscr() == NULL) {
+    fprintf(stderr, "terminal setup failed\n");
+    exit (1);
+  }
   noecho(); /* Echo off */
   cbreak(); /* nl- or cr not needed */
   keypad(stdscr,TRUE); /* Use key symbols as