Package: gammu
Version: 1.17.90-1
Severity: normal
Tags: patch

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.23.9 (PREEMPT)
Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gammu depends on:
ii  libbluetooth2                 3.24-1     Library to use the BlueZ Linux Blu
ii  libc6                         2.7-6      GNU C Library: Shared libraries
ii  libgammu3                     1.17.90-1  Mobile phone management library
ii  libmysqlclient15off           5.0.45-5   MySQL database client library

gammu recommends no packages.

-- no debconf information

gammu dies while issuing the following command (this should export entry
1 from the backup file as VCARD under output/1.vcf):

$ gammu savefile VCARD21 output/1.vcf backup-2008-01-27 ME 1
Segmentation fault

In my example the target directory (output/) does not exist.  Gammu does
not check if the fopen() of the resulting file was successful.  It just
does a fwrite() which may (as in my case) segfault.

Patch which checks the return value of fopen() appended.

  Best regards from Erlangen/Germany!
  Marcus Obst

--- gammu-1.17.90/gammu/backup.c        2008-01-08 08:13:10.000000000 +0100
+++ gammu-1.17.90.patched/gammu/backup.c        2008-01-28 22:32:59.000000000 
+0100
@@ -138,6 +138,10 @@
        }
 
        file = fopen(argv[3],"wb");
+       if (file == NULL) {
+               printf_err(_("Error while opening file for writing!\n"));
+               exit(-1);
+       }
        if (j != fwrite(Buffer,1,j,file)) {
                printf_err(_("Error while writing file!\n"));
        }



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to