瀏覽代碼

Merge remote-tracking branch 'upstream/candidate-3.8.6' into candidate-3.8.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 年之前
父節點
當前提交
363257f589
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      dali/base/dadfs.cpp

+ 5 - 3
dali/base/dadfs.cpp

@@ -3903,15 +3903,17 @@ struct SuperFileSubTreeCache
             name = "UNKNOWN";
         // HACK: This is temporary and should not linger beyond 3.8.x
         unsigned subList[n];
-        memset(subList, 0, sizeof(subList));
+        memset(subList, 0, n * sizeof(unsigned));
         // HACKEND
         ForEach (*subit) {
             IPropertyTree &sub = subit->query();
             unsigned sn = sub.getPropInt("@num",0);
             // HACK: This is temporary and should not linger beyond 3.8.x
-            if (subList[sn])
+            if (!sn)
+                throw MakeStringException(-1,"CDistributedSuperFile: SuperFile %s corrupt, missing subfile part number",name);
+            if (subList[sn-1])
                 throw MakeStringException(-1,"CDistributedSuperFile: SuperFile %s corrupt, double subfile part number %d of %d",name,sn,n);
-            subList[sn]++;
+            subList[sn-1]++;
             // HACKEND
             if ((sn>0)&&(sn<=n)) 
                 subs[sn-1] = &sub;