From 932b738026213a7dd81b011ed0cdb8fd0b182b18 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 19 Jun 2012 15:20:13 -0700 Subject: [PATCH] Eliminate unlikely transient blobstore TOCTOU bug --- .../java/org/jclouds/blobstore/TransientStorageStrategy.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blobstore/src/main/java/org/jclouds/blobstore/TransientStorageStrategy.java b/blobstore/src/main/java/org/jclouds/blobstore/TransientStorageStrategy.java index 1c011141f7..611e93ba25 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/TransientStorageStrategy.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/TransientStorageStrategy.java @@ -79,8 +79,9 @@ public class TransientStorageStrategy { } public void removeBlob(final String containerName, final String blobName) { - if (containerToBlobs.containsKey(containerName)) - containerToBlobs.get(containerName).remove(blobName); + Map map = containerToBlobs.get(containerName); + if (map != null) + map.remove(blobName); } public Iterable getBlobKeysInsideContainer(final String containerName) {