butc-xbsa-buffersize-20090315
authorMike Meffie <mmeffie@sinenomine.net>
Sun, 15 Mar 2009 18:19:15 +0000 (18:19 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 15 Mar 2009 18:19:15 +0000 (18:19 +0000)
LICENSE IPL10
FIXES 124425

restrict buffer size to allow for header space

src/butc/dump.c

index e1aff6f..5c08b67 100644 (file)
@@ -358,6 +358,13 @@ dumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr)
                }
            }
 
+#ifdef xbsa
+           /* Set aside space for the trailing volume header when using large buffers. */
+           if (XBSAMAXBUFFER < toread + sizeof(hostVolumeHeader)) {
+               toread = XBSAMAXBUFFER - sizeof(hostVolumeHeader);
+           }
+#endif
+
            /* Read some volume data. */
            if (fragmentvolume) {
                bytesread = 0;