| -rw-r--r-- | catalina/catalina-binary-formatter.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/catalina/catalina-binary-formatter.c b/catalina/catalina-binary-formatter.c index 9b54b6d..18cd549 100644 --- a/catalina/catalina-binary-formatter.c +++ b/catalina/catalina-binary-formatter.c @@ -686,6 +686,8 @@ catalina_binary_formatter_read_uint (CatalinaBinaryFormatter *formatter, * Serializes @value into a buffer which is stored at the location @buffer. * The resulting buffer length is stored to @buffer_length. * + * This method is not safe for files which are to move between architectures. + * * Return value: %TRUE on success */ gboolean @@ -721,6 +723,8 @@ catalina_binary_formatter_write_long (CatalinaBinaryFormatter *formatter, * Deserializes a #glong from @buffer and stores it at the location pointed * by @value. * + * This method is not safe for files which are to move between architectures. + * * Return value: %TRUE on success */ gboolean @@ -738,7 +742,7 @@ catalina_binary_formatter_read_long (CatalinaBinaryFormatter *formatter, if (((guchar)buffer [0]) != BINARY_FORMATTER_TYPE_LONG) return FALSE; - memcpy (&be_value, buffer + 1, 8); + memcpy (&be_value, buffer + 1, sizeof (glong)); *value = GLONG_FROM_BE (be_value); return TRUE; @@ -755,6 +759,9 @@ catalina_binary_formatter_read_long (CatalinaBinaryFormatter *formatter, * Serializes @value into a buffer which is stored at the location @buffer. * The resulting buffer length is stored to @buffer_length. * + * This method is not safe for data files which are to be moved between + * architectures. + * * Return value: %TRUE on success */ gboolean @@ -790,6 +797,9 @@ catalina_binary_formatter_write_ulong (CatalinaBinaryFormatter *formatter, * Deserializes a #gulong from @buffer and stores it at the location pointed * by @value. * + * This method is not safe for data files which are to be moved between + * architectures. + * * Return value: %TRUE on success */ gboolean @@ -807,7 +817,7 @@ catalina_binary_formatter_read_ulong (CatalinaBinaryFormatter *formatter, if (((guchar)buffer [0]) != BINARY_FORMATTER_TYPE_ULONG) return FALSE; - memcpy (&be_value, buffer + 1, 8); + memcpy (&be_value, buffer + 1, sizeof(gulong)); *value = GULONG_FROM_BE (be_value); return TRUE; |
