summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-10-05 04:47:28 +0200
committerlpsolit%gmail.com <>2006-10-05 04:47:28 +0200
commit8d5dd5786873437f9fa840679cd94172e8ca30f1 (patch)
tree7c3d8599dfe32aa1326c2a2b50de1f22bb08f8d0
parent11be725848887b59c3a266c0302eae5328a5fc01 (diff)
downloadbugzilla-8d5dd5786873437f9fa840679cd94172e8ca30f1.tar.gz
bugzilla-8d5dd5786873437f9fa840679cd94172e8ca30f1.tar.xz
Bug 355230: [PostgreSQL] Crash if sharer_id is not an integer - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap a=myk
-rwxr-xr-xbuglist.cgi3
-rw-r--r--template/en/default/global/user-error.html.tmpl6
2 files changed, 6 insertions, 3 deletions
diff --git a/buglist.cgi b/buglist.cgi
index d226ec8a8..44565f1af 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -221,8 +221,9 @@ sub LookupNamedQuery {
$name || ThrowUserError("query_name_missing");
trick_taint($name);
if ($sharer_id) {
- trick_taint($sharer_id);
$owner_id = $sharer_id;
+ detaint_natural($owner_id);
+ $owner_id || ThrowUserError('illegal_user_id', {'userid' => $sharer_id});
}
else {
$owner_id = $user->id;
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 58eaf5893..3fdc24d4d 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -966,7 +966,7 @@
[% docslinks = {'query.html' => "Searching for $terms.bugs",
'list.html' => "$terms.Bug lists"} %]
The search named <em>[% queryname FILTER html %]</em>
- [% IF sharer_id %]
+ [% IF sharer_id && sharer_id != user.id %]
has not been made visible to you.
[% ELSE %]
does not exist.
@@ -1521,8 +1521,10 @@
# search from any error call location. %]
[% namedcmd = Bugzilla.cgi.param("namedcmd") %]
+[% sharer_id = Bugzilla.cgi.param("sharer_id") %]
[% IF namedcmd AND error != "missing_query"
- AND error != "saved_search_used_by_whines" %]
+ AND error != "saved_search_used_by_whines"
+ AND !sharer_id %]
<p>
Alternatively, you can
<a href="buglist.cgi?cmdtype=dorem&amp;remaction=forget&amp;namedcmd=