Skip to content

Commit 92c186a

Browse files
committed
MiraMon: remove useless nullptr check (fixes https://github.com/OSGeo/gdal/security/code-scanning/627)
1 parent 4d2e653 commit 92c186a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ogr/ogrsf_frmts/miramon/mm_wrlayr.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -2643,13 +2643,13 @@ int MMAppendBlockToBuffer(struct MM_FLUSH_INFO *FlushInfo)
26432643
// Copy the contents of a temporary file to a final file.
26442644
// Used everywhere when closing layers.
26452645
int MMMoveFromFileToFile(FILE_TYPE *pSrcFile, FILE_TYPE *pDestFile,
2646-
MM_FILE_OFFSET *nOffset)
2646+
MM_FILE_OFFSET *pnOffset)
26472647
{
26482648
size_t bufferSize = 1024 * 1024; // 1 MB buffer;
26492649
unsigned char *buffer;
26502650
size_t bytesRead, bytesWritten;
26512651

2652-
if (!pSrcFile || !pDestFile || !nOffset)
2652+
if (!pSrcFile || !pDestFile || !pnOffset)
26532653
return 0;
26542654

26552655
buffer = (unsigned char *)calloc_function(bufferSize);
@@ -2658,7 +2658,7 @@ int MMMoveFromFileToFile(FILE_TYPE *pSrcFile, FILE_TYPE *pDestFile,
26582658
return 1;
26592659

26602660
fseek_function(pSrcFile, 0, SEEK_SET);
2661-
fseek_function(pDestFile, *nOffset, SEEK_SET);
2661+
fseek_function(pDestFile, *pnOffset, SEEK_SET);
26622662
while ((bytesRead = fread_function(buffer, sizeof(unsigned char),
26632663
bufferSize, pSrcFile)) > 0)
26642664
{
@@ -2669,8 +2669,7 @@ int MMMoveFromFileToFile(FILE_TYPE *pSrcFile, FILE_TYPE *pDestFile,
26692669
free_function(buffer);
26702670
return 1;
26712671
}
2672-
if (nOffset)
2673-
(*nOffset) += bytesWritten;
2672+
(*pnOffset) += bytesWritten;
26742673
}
26752674
free_function(buffer);
26762675
return 0;

0 commit comments

Comments
 (0)