Skip to content

ArrowArrayAppendBytes has a narrowing cast when appending views with >INT32_MAX bytes #938

Closed

Description

@paleolimbot

Found by Codex when reviewing #930

The offending narrowing cast is:

  if (private_data->storage_type == NANOARROW_TYPE_STRING_VIEW ||
      private_data->storage_type == NANOARROW_TYPE_BINARY_VIEW) {
    struct ArrowBuffer* data_buffer = ArrowArrayBuffer(array, 1);
    union ArrowBinaryView bvt;
    bvt.inlined.size = (int32_t)value.size_bytes;

    if (value.size_bytes <= NANOARROW_BINARY_VIEW_INLINE_SIZE) {
      memcpy(bvt.inlined.data, value.data.as_char, value.size_bytes);
      memset(bvt.inlined.data + bvt.inlined.size, 0,
             NANOARROW_BINARY_VIEW_INLINE_SIZE - bvt.inlined.size);
    }

Activity

  1. added a commit that references this issue on Sep 29, 2026
    ecba475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions