Skip to content

Commit

Permalink
Fix (unlikely) truncation in write_xbm_image()
Browse files Browse the repository at this point in the history
The usual qsizetype -> int problem. Fix by using auto.

Pick-to: 6.8
Change-Id: Ie990dec39c8c33cdc055da6bfee451319825c934
Reviewed-by: Thiago Macieira <[email protected]>
Reviewed-by: Ivan Solovev <[email protected]>
  • Loading branch information
marcmutz committed Jul 21, 2024
1 parent f7d1d5c commit 0cef4ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/image/qxbmhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static bool write_xbm_image(const QImage &sourceImage, QIODevice *device, const
int h = image.height();
int i;
const QByteArray s = fileName.toUtf8(); // get file base name
int msize = s.size() + 100;
const auto msize = s.size() + 100;
char *buf = new char[msize];

qsnprintf(buf, msize, "#define %s_width %d\n", s.data(), w);
Expand Down

0 comments on commit 0cef4ae

Please sign in to comment.