Your message dated Mon, 10 Feb 2025 11:36:02 +0000
with message-id <[email protected]>
and subject line Bug#511922: fixed in xbubble 0.5.11.2-4
has caused the Debian Bug report #511922,
regarding Please check the return value of more functions
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
511922: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511922
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xbubble
Version: 0.5.11.2-2
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu jaunty ubuntu-patch

Hi,

In Ubuntu we turn on various compiler flags by default, meaning that
there more problems in code cause build failures. Your package was
one that failed due to these compiler flags.

The attached patch adds some more checking of return values of
functions calls, please consider applying it.

Thanks,

James
diff -u xbubble-0.5.11.2/debian/changelog xbubble-0.5.11.2/debian/changelog
only in patch2:
unchanged:
--- xbubble-0.5.11.2.orig/src/loadpng.c
+++ xbubble-0.5.11.2/src/loadpng.c
@@ -18,6 +18,7 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <png.h>
@@ -43,7 +44,8 @@
   FILE *fd;
   unsigned char *data;
   unsigned char header[8];
-  int  bit_depth, color_type, i;
+  unsigned char *header_ptr;
+  int  bit_depth, color_type, i, bytes_to_read, bytes_read;
   png_uint_32  png_width, png_height, rowbytes;
   png_structp png_ptr;
   png_infop info_ptr;
@@ -55,7 +57,22 @@
     return NULL;
   }
   /* ensure that we opened a PNG file */
-  fread( header, 1, 8, fd );
+  bytes_to_read = 8;
+  header_ptr = header;
+  do {
+    bytes_read = fread( header_ptr, 1, bytes_to_read, fd );
+    if (bytes_read == bytes_to_read)
+      break;
+    if (bytes_read >= 0) {
+      bytes_to_read -= bytes_read;
+      header_ptr += bytes_read;
+    }
+  } while (bytes_read >= 0 || errno == EINTR);
+  if (bytes_read == 0) {
+    fclose(fd);
+    fprintf(stderr,_("Error reading from %s.\n"), file);
+    return NULL;
+  }
   if ( ! png_check_sig( header, 8 ) ) {
     fclose(fd);
     fprintf(stderr,_("File %s does not have a valid PNG signature.\n"), file);
only in patch2:
unchanged:
--- xbubble-0.5.11.2.orig/src/init.c
+++ xbubble-0.5.11.2/src/init.c
@@ -97,7 +97,8 @@
       path_max = 4096;
 #endif
     abs_data_dir = (char *) xmalloc( path_max * sizeof(char));
-    realpath( data_dir, abs_data_dir );
+    if (!realpath( data_dir, abs_data_dir ))
+      return NULL;
     offset = strlen(abs_data_dir);
     if ( offset > 1024-128 )
       offset = 1024-128;
@@ -119,8 +120,9 @@
 }
 
 
-static void load_levels( const char * file ) {
+static void load_levels( const char * file_path ) {
   FILE *fd;
+  char * file;
   char line[128];
   unsigned char r[8];
   int i, cell = 0;
@@ -129,7 +131,11 @@
   int color, parse_error = 0;
 
   nb_levels = 0;
-  file = data_file(file, 0);
+  file = data_file(file_path, 0);
+  if ( file == NULL ) {
+    warn( _("cannot open levels file %s."), file_path);
+    return;
+  }
 
   fd = fopen( file, "r" );
   if ( fd == NULL ) {
@@ -232,6 +238,7 @@
 
 static XFontStruct * load_font( int pixel_size ) {
   XFontStruct * xfont;
+  char * font_path;
   char name[128];
   int i;
   static int added_font_path = 0;
@@ -245,7 +252,10 @@
   }
   /* let's see if we can supply a font */
   if ( ! added_font_path ) {
-    add_font_path(data_file("",0));
+    font_path = data_file("", 0);
+    if ( font_path == NULL )
+      fail( _("couldn't determine path to load font !") );
+    add_font_path(font_path);
     added_font_path = 1;
   }
   sprintf( name, SUPPLIED_FONT, pixel_size );
@@ -276,8 +286,13 @@
   RgbaImage ri1;
   RgbaImage ri2;
   Frame frame = (Frame) xmalloc( sizeof( struct _Frame ));
+  char * png_file;
 
-  ri1 = create_rgba_image_from_png_file(data_file(file,1));
+  png_file = data_file(file, 1);
+  if ( png_file == NULL ) {
+    fail(_("Couldn't get file to load frame from"));
+  }
+  ri1 = create_rgba_image_from_png_file(png_file);
 /*   ri2 = ( zoom < 1.0 )? scale_rgba_image( ri1, zoom, zoom ) : ri1; */
   ri2 = scale_rgba_image( ri1, zoom, zoom ) ;
   pmask = ( ri2->has_alpha )? &mask : NULL;
@@ -322,11 +337,16 @@
   char line[128];
   char framename[128];
   FILE *fd;
+  char * animation_file;
 
   /* open animation description file */
-  fd = fopen( data_file(filename,1), "r" );
+  animation_file = data_file(filename,1);
+  if ( animation_file == NULL ) {
+    fail(_("couldn't get file to load animation from"));
+  }
+  fd = fopen( animation_file, "r" );
   if ( fd == NULL )
-    fail( _("cannot open animation file %s."), data_file(filename,1) );
+    fail( _("cannot open animation file %s."), animation_file );
   
   /* count frames */
   while ( fgets( line, 128, fd ) != NULL ) {
@@ -362,7 +382,13 @@
 static void load_scaled_image( const char *file, Pixmap *pix, Pixmap *mask, double zoom ) {
   RgbaImage ri1;
   RgbaImage ri2;
-  ri1 = create_rgba_image_from_png_file(data_file(file,1));
+  char * png_file;
+
+  png_file = data_file(file, 1);
+  if ( png_file == NULL ) {
+    fail(_("Couldn't load file to scale image"));
+  }
+  ri1 = create_rgba_image_from_png_file(png_file);
   ri2 = ( zoom < 1.0 )? scale_rgba_image( ri1, zoom, zoom ) : ri1;
   create_pixmaps_from_rgba_image( ri2, pix, mask );
   delete_rgba_image(ri1);
@@ -390,8 +416,13 @@
   Pixmap mask;
   Frame frame;
   int i;
+  char * canon_data_file;
 
-  ri2 = create_rgba_image_from_png_file(data_file("canon.png",1));  
+  canon_data_file = data_file("canon.png",1);
+  if ( canon_data_file == NULL ) {
+      fail(_("Couldn't load file for canon information"));
+  }
+  ri2 = create_rgba_image_from_png_file(canon_data_file);
   ri2->hotx = CANON_CX;
   ri2->hoty = CANON_CY;
   ri = scale_rgba_image( ri2, zoom, zoom );
@@ -503,6 +534,9 @@
   
   /* bubble animation */
   dir = data_file("./",1);
+  if ( dir == NULL ) {
+      fail(_("couldn't get dir for loading bubble"));
+  }
 
   n = scandir(dir, &namelist, diren_select_bubbles , alphasort);
   if (n < 0) fail(_("Error while scanning %s"),dir);
@@ -747,6 +781,7 @@
   char * subtitle = _("Loading graphics ...");
 
   const char *config_file = "config.txt";
+  char * config_data_file;
   FILE *fd = NULL ;
   char line[128];
   char *copy = NULL;
@@ -759,7 +794,11 @@
   double newzoom = zoom;
   int i;
 
-  fd = fopen( data_file(config_file,1), "r" );
+  config_data_file = data_file(config_file,1);
+  if ( config_data_file == NULL ) {
+    fail(_("Couldn't find data file for splash screen"));
+  }
+  fd = fopen( config_data_file, "r" );
   if(fd) { /* time to change default values... */
     while ( fgets( line, 128, fd ) != NULL ) {
       lc++;

--- End Message ---
--- Begin Message ---
Source: xbubble
Source-Version: 0.5.11.2-4
Done: Andreas Tille <[email protected]>

We believe that the bug you reported is fixed in the latest version of
xbubble, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Tille <[email protected]> (supplier of updated xbubble package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 31 Jan 2025 11:26:38 +0100
Source: xbubble
Architecture: source
Version: 0.5.11.2-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Games Team <[email protected]>
Changed-By: Andreas Tille <[email protected]>
Closes: 511922 738059 853709 1081608
Changes:
 xbubble (0.5.11.2-4) unstable; urgency=medium
 .
   * Team upload.
   * Maintain package in Debian Games team
   * Revert change of original Homepage to alioth despite original
     Homepage is not up to date and does not provide the latest version
     packaged here.  But alioth is dead and linking there makes no sense
     Closes: #1081608
   * Confess there are no upstream releases any more by turning watch file
     into fake rather than pointing to not existent URL
   * Do not start synopsis with an article
   * debhelper 13
   * Switch from cdbs to dh
   * Enable dh_autoreconfigure
   * d/copyright: DEP5
   * Propagate hardening options
   * Standards-Version: 4.7.0 (routine-update)
   * Remove trailing whitespace in debian/changelog (routine-update)
   * Remove trailing whitespace in debian/rules (routine-update)
   * Trim trailing whitespace.
   * Finally apply full patch to check the return value of functions
     Closes: #511922
   * Provide desktop file instead of menu file
     Closes: #738059
   * Confirm NMU 0.5.11.2-3.4
     Closes: #853709
   * Lintian-overrides: desktop-command-not-in-package (desktop is in
     data package while executable is in arch dependant package)
Checksums-Sha1:
 e607372dd8124159d00be4a7f4b0dfe7cf4aa62d 2032 xbubble_0.5.11.2-4.dsc
 af0217efcafd4ea235e2c8da099420deeb839cfc 107040 
xbubble_0.5.11.2-4.debian.tar.xz
 58d77b7e53a3df77c3148b392cc70b656bee5d2c 7082 
xbubble_0.5.11.2-4_amd64.buildinfo
Checksums-Sha256:
 3ce17134a2d938305eacf425bb7f15a0c65caa69004004b2dc6789ef80bc3a29 2032 
xbubble_0.5.11.2-4.dsc
 5e5b3eeac5fa5ba14cc1fdb2ea533abce577073e6e93dd6503463fc0ffae485d 107040 
xbubble_0.5.11.2-4.debian.tar.xz
 ad5d3c468b8b4707469bf74de419bb3586a132accdd7b4f658a1ed51f2bcc55a 7082 
xbubble_0.5.11.2-4_amd64.buildinfo
Files:
 f98249ddd944a62a47b7a21ddf6c6779 2032 games optional xbubble_0.5.11.2-4.dsc
 5dfe3b3840a208f2acf71a715c7cd85f 107040 games optional 
xbubble_0.5.11.2-4.debian.tar.xz
 dcf44fbaca7bce0d0194d7ba02fe8fa8 7082 games optional 
xbubble_0.5.11.2-4_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEE8fAHMgoDVUHwpmPKV4oElNHGRtEFAmecphURHHRpbGxlQGRl
Ymlhbi5vcmcACgkQV4oElNHGRtF/MRAAiGD/tyTZ+N8SZ9uBxPci7cZ+Mg4dB/v1
7iMnnWFmOcpXK7K/6ujqprg4G0egLjBfIX0UA8H0OkMSNysSu66ard8wheRiDJ3B
Yv33BzWBxK9N3DY2m5hfjMG1QCo7xC1qRCkQfJH8TFTswQqQqD1LRSvePdtdYgt/
0VYaGaGTEGGAkmgd2NhyFt7rvNnMozUp+UrnflCP5XF6x4Fsar5FNHIeOj6pbNAf
Aq8vEI6wRqlWBS+wHK2ao9kgeLT+aW4BpFF1Zi2+YodRzI431b7/El+RNB6IU+rH
kBzONrkrjDAPPbcLViiWeccxVwKunC3JIAf4tF+UFiklIpE0//NdoCljn2Gi9ywu
PA+rmfqZ1PagSAtvYYYM1lZvHCCqDyGkTudWSti2rcwKMFjVT/at+Iey1gSfS95X
PxNZr2WgBY8O2uV8QuDCaV0K71KQveZhjbpgTY6c9RRTfNYDN/NAcXpPHB3iYC3y
15jIv5ln7Xusy0gO8x2lGbyvOWC58bA35a4dHgrTGfbHl7vwnxyey0GIQi8V5Ysb
SywDVPRKboaIWSdVuSDsn3ELu/vP0TEr1N3vfbB7eAtIaMytkJiid0W+Bnz3u+Xr
tMLr6+5ugcHnU7tlZLyczR5z/UM2vJOMRojijZbuuUk5+SjIFdyTZM0IBxocALAI
/yGRpyEAZvo=
=S6zB
-----END PGP SIGNATURE-----

Attachment: pgpILBoSWjRaA.pgp
Description: PGP signature


--- End Message ---

Reply via email to