From 3093688d4264f5c53bb0fa6dafca3b65e8875b5b Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 10 Aug 2012 23:53:33 +0000 Subject: Don't read/write after the string when the synthesis is slightly malformed --- URPM.xs | 2 +- t/synthesis.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/URPM.xs b/URPM.xs index b0338b1..b7a6462 100644 --- a/URPM.xs +++ b/URPM.xs @@ -1759,7 +1759,7 @@ Pkg_filename(pkg) if (pkg->info) { char *eon; - if ((eon = strchr(pkg->info, '@')) != NULL) { + if ((eon = strchr(pkg->info, '@')) != NULL && strlen(eon) >= 3) { char savbuf[4]; memcpy(savbuf, eon, 4); /* there should be at least epoch and size described so (@0@0 minimum) */ memcpy(eon, ".rpm", 4); diff --git a/t/synthesis.t b/t/synthesis.t index 8246b36..1b7e8d6 100644 --- a/t/synthesis.t +++ b/t/synthesis.t @@ -14,7 +14,7 @@ my $s = <<'EOF'; @requires@/sbin/install-info@glibc == 2.2.4@kernel-headers@kernel-headers >= 2.2.1@/bin/sh@/bin/sh@/bin/sh@rpmlib(PayloadFilesHavePrefix) <= 4.0-1@rpmlib(CompressedFileNames) <= 3.0.4-1 @conflicts@texinfo < 3.11@gcc < 2.96-0.50mdk @obsoletes@libc-debug@libc-headers@libc-devel@linuxthreads-devel@glibc-debug -@info@glibc-devel-2.2.4-25mdk.i586@6@45692097@Development/C +@info@glibc-devel-2.2.4-25mdk.i586@ EOF open my $f, "| gzip -9 >$file1"; -- cgit v1.2.1