--- sal/rtl/source/hash.cxx
+++ sal/rtl/source/hash.cxx
@@ -301,6 +301,9 @@
     pHash->pData[n++] = NULL;
     pHash->nEntries--;
 
+    if (n >= pHash->nSize)
+        n = 0;
+
     while ((pHashStr = pHash->pData[n]) != NULL) {
         pHash->pData[n] = NULL;
         // FIXME: rather unsophisticated and N^2 in chain-length, but robust.
