Skip to content

[R] Switch sprintf to snprintf #3724

@coatless

Description

@coatless

From @rcurtin regarding the 4.4.0 R build on matrix, we have R CMD check returning:

* checking compiled code ... WARNING
File ‘mlpack/libs/mlpack.so’:
  Found ‘__sprintf_chk’, possibly from ‘sprintf’ (C)
    Object: ‘image_converter.o’

The quick fix here is to switch sprintf() use cases to snprintf() in the offending stb_image_write.h library to ensure a maximum number of bytes to be used in the buffer declared.

/cc @eddelbuettel

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions