aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-08-13 19:58:22 +0000
committerThierry Vignaud <tv@mageia.org>2012-08-13 19:58:22 +0000
commit54cfe596c064022e68e01d19ac7aa18d3c6fb35c (patch)
tree263416c2dd1e1bbbb17c2926104de7f40cbac31a
parent3ae6eb8a6755478aae79a176f700dfc29068207a (diff)
downloadperl-URPM-54cfe596c064022e68e01d19ac7aa18d3c6fb35c.tar
perl-URPM-54cfe596c064022e68e01d19ac7aa18d3c6fb35c.tar.gz
perl-URPM-54cfe596c064022e68e01d19ac7aa18d3c6fb35c.tar.bz2
perl-URPM-54cfe596c064022e68e01d19ac7aa18d3c6fb35c.tar.xz
perl-URPM-54cfe596c064022e68e01d19ac7aa18d3c6fb35c.zip
Don't read/write after the string when the synthesis is slightly malformed
(backported from trunk)
-rw-r--r--NEWS2
-rw-r--r--URPM.xs2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 66a7c73..6de271b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
- do not try to parse current pointer when the line is invalid or
empty (detected by valgrind)
+- don't read/write after the string when the synthesis is slightly
+ malformed
Version 3.40.1 - 28 June 2012
diff --git a/URPM.xs b/URPM.xs
index c3e95ff..a32bf49 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1897,7 +1897,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);