Skip to content

_php_ibase_attach_db() does not check buffer overflow #108

@mlazdans

Description

@mlazdans

dpb_len = slprintf(dpb, buf_len, "%c%c%s", dpb_args[i],(unsigned char)len[i],args[i]);

Use snprintf() instead slprintf()

https://www.phpinternalsbook.com/php7/internal_types/strings/printing_functions.html

snprintf() returns the number of characters that could have been used, whereas slprintf() returns the number of characters that have effectively been used, thus enabling to detect too-small buffers and string truncation. This, is not counting the final ‘\0’.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions