diff options
author | Guillem Jover <guillem@debian.org> | 2009-07-13 02:44:48 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2009-07-13 13:54:20 +0200 |
commit | 2a7cbd9bbad67021e447068521fd60d42e02cb46 (patch) | |
tree | d18f69120c771082be7d8de61c1b4e3cfdf6650d /dpkg-split | |
parent | de24e8d710686a4e271caaccfe3f46a4619ecba1 (diff) | |
download | dpkg-2a7cbd9bbad67021e447068521fd60d42e02cb46.tar.gz |
dpkg-split: Properly check error condition on open when splitting
Diffstat (limited to 'dpkg-split')
-rw-r--r-- | dpkg-split/split.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dpkg-split/split.c b/dpkg-split/split.c index 624385177..af8a989cf 100644 --- a/dpkg-split/split.c +++ b/dpkg-split/split.c @@ -62,7 +62,8 @@ void do_split(const char *const *argv) { sprintf(partsizebuf,"%ld",maxpartsize-HEADERALLOWANCE); sprintf(partsizeallowbuf,"%ld",maxpartsize); fd= open(sourcefile,O_RDONLY); - if (!fd) ohshite(_("unable to open source file `%.250s'"),sourcefile); + if (fd < 0) + ohshite(_("unable to open source file `%.250s'"), sourcefile); if (fstat(fd,&stab)) ohshite(_("unable to fstat source file")); if (!S_ISREG(stab.st_mode)) ohshit(_("source file `%.250s' not a plain file"),sourcefile); sprintf(lengthbuf,"%lu",(unsigned long)stab.st_size); |