diff options
author | Guillem Jover <guillem@debian.org> | 2012-03-24 15:36:38 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2012-03-27 20:52:43 +0200 |
commit | dea55367975a289fe8aecc828976837824ae77b2 (patch) | |
tree | 11ebb4e3e7014396f3402d71561d25a7e5800374 /dpkg-split | |
parent | c0d7a6552b4c4adedb9a69ff0530c0d062c3e961 (diff) | |
download | dpkg-dea55367975a289fe8aecc828976837824ae77b2.tar.gz |
libdpkg: Refactor ar member check into new dpkg_ar_member_is_illegal()
Diffstat (limited to 'dpkg-split')
-rw-r--r-- | dpkg-split/info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dpkg-split/info.c b/dpkg-split/info.c index 6066f73a5..ea51b2ec0 100644 --- a/dpkg-split/info.c +++ b/dpkg-split/info.c @@ -99,7 +99,7 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir) if (strncmp(arh.ar_name, PARTMAGIC, sizeof(arh.ar_name)) != 0) return NULL; - if (memcmp(arh.ar_fmag,ARFMAG,sizeof(arh.ar_fmag))) + if (dpkg_ar_member_is_illegal(&arh)) ohshit(_("file `%.250s' is corrupt - bad magic at end of first header"),fn); thisilen = dpkg_ar_member_get_size(fn, &arh); if (thisilen >= readinfobuflen) { @@ -162,7 +162,7 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir) dpkg_ar_normalize_name(&arh); - if (memcmp(arh.ar_fmag,ARFMAG,sizeof(arh.ar_fmag))) + if (dpkg_ar_member_is_illegal(&arh)) ohshit(_("file `%.250s' is corrupt - bad magic at end of second header"),fn); if (strncmp(arh.ar_name,"data",4)) ohshit(_("file `%.250s' is corrupt - second member is not data member"),fn); |