Commit c44d2c79 by Shahbaz Youssefi Committed by Commit Bot

Fix glGetProgramResourceName filling output with 0

strncpy was used to copy resource names, which fills the unused parts of the buffer with '\0'. The spec doesn't forbid this, but dEQP fails on this behavior, presumably to try and catch overflow bugs. Bug: angleproject:3562 Change-Id: Ifce2d690221b2403848cb8913f4753ec60dfffab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1698647 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com>
parent b243a2a4
......@@ -184,15 +184,19 @@ GLint GetVariableLocation(const std::vector<VarT> &list,
return -1;
}
void CopyStringToBuffer(GLchar *buffer, const std::string &string, GLsizei bufSize, GLsizei *length)
void CopyStringToBuffer(GLchar *buffer,
const std::string &string,
GLsizei bufSize,
GLsizei *lengthOut)
{
ASSERT(bufSize > 0);
strncpy(buffer, string.c_str(), bufSize);
buffer[bufSize - 1] = '\0';
size_t length = std::min<size_t>(bufSize - 1, string.length());
memcpy(buffer, string.c_str(), length);
buffer[length] = '\0';
if (length)
if (lengthOut)
{
*length = static_cast<GLsizei>(strlen(buffer));
*lengthOut = length;
}
}
......
......@@ -532,7 +532,7 @@
1665 WIN NVIDIA OPENGL : dEQP-GLES31.functional.draw_indirect.negative.command_offset_not_in_buffer_unsigned32_wrap = FAIL
1442 NVIDIA OPENGL : dEQP-GLES31.functional.fbo.no_attachments.maximums.all = FAIL
1442 OPENGL : dEQP-GLES31.functional.program_interface_query.atomic_counter_buffer.referenced_by* = FAIL
1442 OPENGL : dEQP-GLES31.functional.program_interface_query.buffer_limited_query.* = FAIL
1442 OPENGL : dEQP-GLES31.functional.program_interface_query.buffer_limited_query.resource_query = FAIL
1442 OPENGL : dEQP-GLES31.functional.program_interface_query.buffer_variable.* = FAIL
1442 OPENGL : dEQP-GLES31.functional.program_interface_query.program_input.* = FAIL
1442 OPENGL : dEQP-GLES31.functional.program_interface_query.program_output.* = FAIL
......@@ -628,7 +628,7 @@
3605 VULKAN : dEQP-GLES31.functional.texture.gather.offset.* = FAIL
// Front-end query bugs:
3520 VULKAN : dEQP-GLES31.functional.program_interface_query.buffer_limited_query.resource_*query = FAIL
3520 VULKAN : dEQP-GLES31.functional.program_interface_query.buffer_limited_query.resource_query = FAIL
3520 VULKAN : dEQP-GLES31.functional.program_interface_query.program_*.resource_list.compute.empty = FAIL
3520 VULKAN : dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.* = FAIL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment