diff options
author | Christiaan Welvaart <cjw@mageia.org> | 2011-07-15 09:13:12 +0000 |
---|---|---|
committer | Christiaan Welvaart <cjw@mageia.org> | 2011-07-15 09:13:12 +0000 |
commit | cb443900ba9aa12c691441c23e0f858c3c3e694f (patch) | |
tree | 803cce26893ab027f587fbac8f2a9322607734ef /g-ir-extract-deps.c | |
parent | 52572ab6938ee2c57edaff9b1efa1aa13ddd53ac (diff) | |
download | rpm-setup-cb443900ba9aa12c691441c23e0f858c3c3e694f.tar rpm-setup-cb443900ba9aa12c691441c23e0f858c3c3e694f.tar.gz rpm-setup-cb443900ba9aa12c691441c23e0f858c3c3e694f.tar.bz2 rpm-setup-cb443900ba9aa12c691441c23e0f858c3c3e694f.tar.xz rpm-setup-cb443900ba9aa12c691441c23e0f858c3c3e694f.zip |
- g-ir-extract-deps: when deps offset is zero, bail out to prevent 1.139
bogus typelib(GOBJ) dependencies
Diffstat (limited to 'g-ir-extract-deps.c')
-rw-r--r-- | g-ir-extract-deps.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/g-ir-extract-deps.c b/g-ir-extract-deps.c index 1c1735d..f0cf725 100644 --- a/g-ir-extract-deps.c +++ b/g-ir-extract-deps.c @@ -52,17 +52,21 @@ int main(int argc, char ** argv) fprintf(stderr, "failed to read deps offset from typelib\n"); exit(1); } - fseek(typelib, deps_offset, SEEK_SET); - if (fscanf(typelib, "%8191s", deps) < 1) + if (deps_offset > 0) { - fprintf(stderr, "failed to read deps from typelib\n"); - exit(1); - } + fseek(typelib, deps_offset, SEEK_SET); + if (fscanf(typelib, "%8191s", deps) < 1) + { + fprintf(stderr, "failed to read deps from typelib\n"); + exit(1); + } + printf("%s\n", deps); + } + free(deps); free(magic); fclose(typelib); - printf("%s\n", deps); return 0; } |