File non-fix-potential-strlcat-overflow.patch of Package non

diff -ru non-non-daw-v1.2.0.orig/FL/Fl_Menu_Settings.C non-non-daw-v1.2.0/FL/Fl_Menu_Settings.C
--- non-non-daw-v1.2.0.orig/FL/Fl_Menu_Settings.C	2017-07-08 19:11:23.000000000 +0200
+++ non-non-daw-v1.2.0/FL/Fl_Menu_Settings.C	2018-05-31 14:47:48.650121196 +0200
@@ -166,9 +166,9 @@
                 // IT'S A SUBMENU
                 // we do not support searches through FL_SUBMENU_POINTER links
                 if ( menupath[0] )
-                    strlcat( menupath, "/", sizeof( menupath ) );
+                    strlcat( menupath, "/", sizeof( menupath ) - strlen( menupath ) - 1 );
 
-                strlcat( menupath, m->label(), sizeof( menupath ) );
+                strlcat( menupath, m->label(), sizeof( menupath ) - strlen( menupath ) - 1 );
 
                 remove_ampersands( menupath, strlen( menupath ) );
 
@@ -202,9 +202,9 @@
                 strcpy( itempath, menupath );
 
                 if ( itempath[0] )
-                    strlcat( itempath, "/", sizeof( itempath ) );
+                    strlcat( itempath, "/", sizeof( itempath ) - strlen( itempath ) - 1 );
 
-                strlcat( itempath, m->label(), sizeof( itempath ) );
+                strlcat( itempath, m->label(), sizeof( itempath ) - strlen( itempath ) - 1 );
 
                 remove_ampersands( itempath, strlen( itempath ) );
 
openSUSE Build Service is sponsored by