[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH 2/2] Review feedback, added check for unexpected EOF in svnlook proplist when reading-ahead in new format.

From: Brett Randall <javabrett_at_gmail.com>
Date: Mon, 24 Aug 2015 10:42:30 +1000

Signed-off-by: Brett Randall <javabrett_at_gmail.com>

---
 contrib/hook-scripts/check-mime-type.pl | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/contrib/hook-scripts/check-mime-type.pl b/contrib/hook-scripts/check-mime-type.pl
index 8789aaa..3ded119 100755
--- a/contrib/hook-scripts/check-mime-type.pl
+++ b/contrib/hook-scripts/check-mime-type.pl
@@ -133,6 +133,10 @@ foreach my $path ( @files_added )
 						# from propname : propvalue format, to values in an indent list on following lines
 						if (not $mime_type)
 							{
+								if ($output_line + 1 >= scalar(@output))
+									{
+										die "$0: Unexpected EOF reading proplist.\n";
+									}
 								my $next_line_pval_indented = $output[$output_line + 1];
 								if ($next_line_pval_indented =~ /^\s{4}(.*)/)
 									{
@@ -145,6 +149,10 @@ foreach my $path ( @files_added )
 						$eol_style = $2;
 						if (not $eol_style)
 							{
+								if ($output_line + 1 >= scalar(@output))
+									{
+										die "$0: Unexpected EOF reading proplist.\n";
+									}
 								my $next_line_pval_indented = $output[$output_line + 1];
 								if ($next_line_pval_indented =~ /^\s{4}(.*)/)
 									{
-- 
2.5.0
Received on 2015-08-24 02:43:02 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.