From 662bf6812ef0a4fa80cf137761f9b1b5a93821c0 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Mon, 19 Jul 2010 22:46:14 +0000 Subject: remove unguarded atom creation to prevent DOS attacks. closes COUCHDB-829 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@965667 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_util.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/couchdb/couch_util.erl') diff --git a/src/couchdb/couch_util.erl b/src/couchdb/couch_util.erl index 2aa69af8..f2bf6297 100644 --- a/src/couchdb/couch_util.erl +++ b/src/couchdb/couch_util.erl @@ -70,9 +70,9 @@ normparts([Part | RestParts], Acc) -> % works like list_to_existing_atom, except can be list or binary and it % gives you the original value instead of an error if no existing atom. to_existing_atom(V) when is_list(V) -> - try list_to_existing_atom(V) catch _ -> V end; + try list_to_existing_atom(V) catch _:_ -> V end; to_existing_atom(V) when is_binary(V) -> - try list_to_existing_atom(?b2l(V)) catch _ -> V end; + try list_to_existing_atom(?b2l(V)) catch _:_ -> V end; to_existing_atom(V) when is_atom(V) -> V. -- cgit v1.2.3