mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
first pass is fast for performance, second is crytographically strong
This commit is contained in:
+2
-1
@@ -1639,7 +1639,8 @@ MagickPrivate MagickBooleanType ShredMagickMemory(void *memory,
|
||||
|
||||
for (j=0; j < length; j+=quantum)
|
||||
{
|
||||
SetRandomKey(random_info,quantum,GetStringInfoDatum(key));
|
||||
if (i != 0)
|
||||
SetRandomKey(random_info,quantum,GetStringInfoDatum(key));
|
||||
(void) memcpy(p,GetStringInfoDatum(key),(size_t)
|
||||
MagickMin(quantum,length-j));
|
||||
p+=quantum;
|
||||
|
||||
@@ -1944,7 +1944,8 @@ MagickPrivate MagickBooleanType ShredFile(const char *path)
|
||||
break;
|
||||
for (j=0; j < (MagickOffsetType) length; j+=count)
|
||||
{
|
||||
SetRandomKey(random_info,quantum,GetStringInfoDatum(key));
|
||||
if (i != 0)
|
||||
SetRandomKey(random_info,quantum,GetStringInfoDatum(key));
|
||||
count=write(file,GetStringInfoDatum(key),(size_t)
|
||||
MagickMin((MagickSizeType) quantum,length-j));
|
||||
if (count <= 0)
|
||||
|
||||
Reference in New Issue
Block a user