Skip to content

Commit

Permalink
Fixing a recently added error about the umber of bytes to be copyied
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelPau committed Apr 17, 2024
1 parent 551bc4d commit e88acdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ogr/ogrsf_frmts/miramon/mm_gdal_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,7 @@ int MM_SecureCopyStringFieldValue(char **pszStringDst, const char *pszStringSrc,

// We just copy the exact number of elements we want to copy.
// If we copy more than them, some garbage can appear in the record
memcpy(*pszStringDst, pszStringSrc, *nStringCurrentLength);
memcpy(*pszStringDst, pszStringSrc, strlen(pszStringSrc));

This comment has been minimized.

Copy link
@rouault

rouault Apr 17, 2024

Collaborator

what about the nul terminating byte? Shouldn't that be strlen(pszStringSrc) + 1 ?

This comment has been minimized.

Copy link
@AbelPau

AbelPau Apr 17, 2024

Author Owner

Yes, I just restored old version in that. The error was at other place. Sorry

return 0;
}

Expand Down

0 comments on commit e88acdc

Please sign in to comment.