Bugzilla – Attachment 65040 Details for
Bug 18854
DoS Offset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18854: Protect few other occurrences of offset
Bug-18854-Protect-few-other-occurrences-of-offset.patch (text/plain), 3.60 KB, created by
Marcel de Rooy
on 2017-07-14 06:43:53 UTC
(
hide
)
Description:
Bug 18854: Protect few other occurrences of offset
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-07-14 06:43:53 UTC
Size:
3.60 KB
patch
obsolete
>From 53bd70bc4b65677cfdc9fb2eb73b665e22dfdb58 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Jul 2017 11:56:46 -0300 >Subject: [PATCH] Bug 18854: Protect few other occurrences of offset >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/AuthoritiesMarc.pm | 2 +- > Koha/SearchEngine/Elasticsearch/Search.pm | 3 ++- > admin/auth_subfields_structure.pl | 3 ++- > admin/auth_tag_structure.pl | 3 ++- > admin/marc_subfields_structure.pl | 3 ++- > 5 files changed, 9 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 87620b4..9f1f284 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -240,7 +240,7 @@ sub SearchAuthorities { > $query="\@or $orderstring $query" if $orderstring; > } > >- $offset=0 unless $offset; >+ $offset = 0 if not defined $offset or $offset < 0; > my $counter = $offset; > $length=10 unless $length; > my @oAuth; >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 9f0e2a5..cec1cb7 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -327,7 +327,8 @@ sub simple_search_compat { > return ('No query entered', undef, undef) unless $query; > > my %options; >- $options{offset} = $offset // 0; >+ $offset = 0 if not defined $offset or $offset < 0; >+ $options{offset} = $offset; > $max_results //= 100; > > unless (ref $query) { >diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl >index 0ba7677..37249e6 100755 >--- a/admin/auth_subfields_structure.pl >+++ b/admin/auth_subfields_structure.pl >@@ -52,7 +52,8 @@ my $input = new CGI; > my $tagfield = $input->param('tagfield'); > my $tagsubfield = $input->param('tagsubfield'); > my $authtypecode = $input->param('authtypecode'); >-my $offset = $input->param('offset') || 0; >+my $offset = $input->param('offset'); >+$offset = 0 if not defined $offset or $offset < 0; > my $op = $input->param('op') || ''; > my $script_name = "/cgi-bin/koha/admin/auth_subfields_structure.pl"; > >diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl >index 4a3a67a..ddf163a 100755 >--- a/admin/auth_tag_structure.pl >+++ b/admin/auth_tag_structure.pl >@@ -35,7 +35,8 @@ my $authtypecode = $input->param('authtypecode') || ''; # set > my $existingauthtypecode = $input->param('existingauthtypecode') || ''; # set when we have to create a new framework (in authtype) by copying an old one (in existingauthtype) > > my $searchfield = $input->param('searchfield') || 0; >-my $offset = $input->param('offset') || 0; >+my $offset = $input->param('offset'); >+$offset = 0 if not defined $offset or $offset < 0; > my $op = $input->param('op') || ''; > $searchfield =~ s/\,//g; > >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 24c8005..077a58b 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -65,7 +65,8 @@ my $tagfield = $input->param('tagfield'); > my $tagsubfield = $input->param('tagsubfield'); > my $frameworkcode = $input->param('frameworkcode'); > my $pkfield = "tagfield"; >-my $offset = $input->param('offset') || 0; >+my $offset = $input->param('offset'); >+$offset = 0 if not defined $offset or $offset < 0; > my $script_name = "/cgi-bin/koha/admin/marc_subfields_structure.pl"; > > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18854
:
64611
|
64612
|
64617
|
64799
|
64800
|
64888
|
64889
|
64969
|
65039
| 65040