diff --git a/extensions/wallet/signonviewer/SignonViewer.js b/extensions/wallet/signonviewer/SignonViewer.js index 03627fa15336..0dc57d13bac2 100644 --- a/extensions/wallet/signonviewer/SignonViewer.js +++ b/extensions/wallet/signonviewer/SignonViewer.js @@ -65,7 +65,9 @@ function Startup() pref = null; } - LoadSignons(); + if (!LoadSignons()) { + return; /* user failed to unlock the database */ + } LoadReject(); LoadNopreview(); LoadNocapture(); @@ -78,6 +80,12 @@ function Startup() function LoadSignons() { signonList = signonviewer.GetSignonValue(); + if (signonList.length == 1) { + /* user supplied invalid database key */ + window.close(); + return false; + } + var delim = signonList[0]; signonList = signonList.split(delim); for(var i = 1; i < signonList.length; i++) @@ -89,6 +97,7 @@ function LoadSignons() var user = currSignon.substring(currSignon.lastIndexOf(":")+1,currSignon.length); AddItem("savesignonlist",[site,user],"signon_",i-1); } + return true; } // function : ::DeleteSignon(); diff --git a/extensions/wallet/src/singsign.cpp b/extensions/wallet/src/singsign.cpp index c711fe19fdfa..4a65836085f3 100644 --- a/extensions/wallet/src/singsign.cpp +++ b/extensions/wallet/src/singsign.cpp @@ -2851,6 +2851,7 @@ SINGSIGN_GetSignonListForViewer(nsAutoString& aSignonList) /* unlock the database */ if (SI_LoadSignonData(PR_TRUE) != 0) { + aSignonList = "."; /* a list of length 1 tells viewer that database was not unlocked */ /* don't display saved signons if user couldn't unlock the database */ return; }