aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-08-13 19:58:18 +0000
committerThierry Vignaud <tv@mageia.org>2012-08-13 19:58:18 +0000
commit3ae6eb8a6755478aae79a176f700dfc29068207a (patch)
tree67ff2ceb4f6f1c95ffef00230b05f5e6c38bdb56
parenta41c497e223d3056050086429a336b30c5ea8864 (diff)
downloadperl-URPM-3ae6eb8a6755478aae79a176f700dfc29068207a.tar
perl-URPM-3ae6eb8a6755478aae79a176f700dfc29068207a.tar.gz
perl-URPM-3ae6eb8a6755478aae79a176f700dfc29068207a.tar.bz2
perl-URPM-3ae6eb8a6755478aae79a176f700dfc29068207a.tar.xz
perl-URPM-3ae6eb8a6755478aae79a176f700dfc29068207a.zip
Do not try to parse current pointer when the line is invalid or empty.
This fixes a "Conditional jump or move depends on uninitialised value" during empty synthesis parsing (backported from trunk)
-rw-r--r--NEWS3
-rw-r--r--URPM.xs3
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 10227f9..66a7c73 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- do not try to parse current pointer when the line is invalid or
+ empty (detected by valgrind)
+
Version 3.40.1 - 28 June 2012
- enable to read xz & bzip2 compressed synthesis
diff --git a/URPM.xs b/URPM.xs
index 9fa8621..c3e95ff 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3353,7 +3353,8 @@ Urpm_parse_synthesis__XS(urpm, filename, ...)
p = &buff[buff_len-(p-buff)];
}
// EOF:
- if (!parse_line(depslist, provides, obsoletes, &pkg, p, urpm, callback))
+ if (ok && buff_len > 0
+ && !parse_line(depslist, provides, obsoletes, &pkg, p, urpm, callback))
ok = 0;
if (Fclose(f) != 0) ok = 0;
SPAGAIN;