Fix decompression of truncated data
[folly.git] / folly / SparseByteSet.h
index 2dc55e87f47554a884200e800d67a1b8a106f98d..04a03eb8e411b1fb923e75264f35622e847d56cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ class SparseByteSet {
     if (r) {
       DCHECK_LT(size_, kCapacity);
       dense_[size_] = i;
-      sparse_[i] = size_;
+      sparse_[i] = uint8_t(size_);
       size_++;
     }
     return r;