]> git.pld-linux.org Git - packages/camwire.git/commitdiff
- rediffed link patch, added bounds patch (fix warnings on strncpy); release 2 (libdc... auto/th/camwire-2.0.0-2
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 9 Jul 2023 09:59:20 +0000 (11:59 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 9 Jul 2023 09:59:20 +0000 (11:59 +0200)
camwire-bounds.patch [new file with mode: 0644]
camwire-link.patch
camwire.spec

diff --git a/camwire-bounds.patch b/camwire-bounds.patch
new file mode 100644 (file)
index 0000000..3339214
--- /dev/null
@@ -0,0 +1,39 @@
+--- camwire2-2.0.0-Source/examples/cammonitor/cammonitor.c.orig        2023-07-09 10:46:29.034985838 +0200
++++ camwire2-2.0.0-Source/examples/cammonitor/cammonitor.c     2023-07-09 11:49:33.674482685 +0200
+@@ -2340,20 +2340,23 @@ static void filename_framenumber(char *n
+                                const int strip,
+                                const long frameno)
+ {
+-    size_t namelen, tokenindex;
++    size_t namelen, tokenindex, outlen;
+     char *token;
+     namelen = strlen(filename);
+     token = strstr(filename, FRAMENUMBER_TOKEN);
+     if (token == NULL)  tokenindex = namelen;
+     else                tokenindex = token - filename;
+-    strncpy(new_name, filename, tokenindex);
+-    new_name[tokenindex] = '\0';
++
++    outlen = (tokenindex < MAX_FILENAME - 12) ? tokenindex : (MAX_FILENAME - 12);
++    memcpy(new_name, filename, outlen);
++    new_name[outlen] = '\0';
+     if (token != NULL)
+     {
+       if (!strip)  sprintf(&new_name[tokenindex], "%011ld", frameno);
+       tokenindex += strlen(FRAMENUMBER_TOKEN);
+     }
++    if (tokenindex + strlen(filename + tokenindex) + 1 <= MAX_FILENAME)
+     strcat(new_name, &filename[tokenindex]);
+ }
+@@ -2817,7 +2820,8 @@ static void settings_load(const Camwire_
+           set->save_num_images = new_settings.save_num_images;
+           set->save_delay = new_settings.save_delay;
+           strncpy(set->imagefilename, new_settings.imagefilename,
+-                  MAX_FILENAME);
++                  MAX_FILENAME-1);
++          set->imagefilename[MAX_FILENAME-1] = '\0';
+       }
+       else    
+       {
index 1069a8274f59b5c6e3911febecf3db63ac4c0ead..ad1397cbd2ce52ddd4ffd6cf02bda49595e0baca 100644 (file)
@@ -8,18 +8,17 @@
  
  # What to install where:
  install (TARGETS camwire camwire_static DESTINATION lib)
---- camwire2-1.9.0-Source/examples/cammonitor/CMakeLists.txt.orig      2011-02-17 03:31:14.000000000 +0100
-+++ camwire2-1.9.0-Source/examples/cammonitor/CMakeLists.txt   2011-08-07 07:21:57.196383177 +0200
-@@ -15,7 +15,8 @@ set_target_properties (cammonitor PROPER
      LINK_FLAGS ${Camwire_SDL_LIBS}
+--- camwire2-2.0.0-Source/examples/cammonitor/CMakeLists.txt.orig      2023-07-09 10:42:48.799512289 +0200
++++ camwire2-2.0.0-Source/examples/cammonitor/CMakeLists.txt   2023-07-09 10:45:58.818482868 +0200
+@@ -20,7 +20,7 @@ set_target_properties (cammonitor PROPER
#     LINK_FLAGS ${Camwire_SDL_LIBS}
        SKIP_BUILD_RPATH ON)
  target_link_libraries (cammonitor
 -      libcamwire.a
 +      camwire
-+       SDL
        dc1394
+       ${Camwire_SDL_LIBS}
        netpbm
-       m
 --- camwire2-1.9.0-Source/examples/CMakeLists.txt.orig 2011-02-17 03:31:14.000000000 +0100
 +++ camwire2-1.9.0-Source/examples/CMakeLists.txt      2011-08-07 07:21:45.499716516 +0200
 @@ -9,7 +9,7 @@ add_executable (hello  hello.c)
index 77381d972bd9ef642c4cfd359cd4c41b2a8651a5..dbeff7de56a62c8ce502aac57df5dd93bc1f2428 100644 (file)
@@ -2,7 +2,7 @@ Summary:        Digital camera library for Linux
 Summary(pl.UTF-8):     Biblioteka obsÅ‚ugi kamer cyfrowych dla Linuksa
 Name:          camwire
 Version:       2.0.0
-Release:       1
+Release:       2
 License:       LGPL v2.1+
 Group:         Libraries
 # camwire1 was for libdc1394 < 2.0, camwire2 for libdc1394 2.1+
@@ -13,6 +13,7 @@ Patch1:               %{name}-etc.patch
 Patch2:                %{name}-lib.patch
 Patch3:                %{name}-bogus-inline.patch
 Patch4:                %{name}-format.patch
+Patch5:                %{name}-bounds.patch
 URL:           http://kauri.auck.irl.cri.nz/~johanns/camwire/
 BuildRequires: SDL-devel
 BuildRequires: cmake >= 2.6
@@ -79,17 +80,20 @@ Camwire.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %build
+install -d build
+cd build
 # disable unused-result warning, compilation failure with -Werror
 CFLAGS="%{rpmcflags} -Wno-unused-result"
-%cmake
+%cmake ..
 %{__make} -j1
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
+%{__make} -C build install \
        DESTDIR=$RPM_BUILD_ROOT
 
 %clean
This page took 0.174024 seconds and 4 git commands to generate.