[vlc-commits] [Git][videolan/libvlcpp][master] 2 commits: Instance: win32: Use the secure flavor of vsnprintf
Hugo Beauzée-Luyssen
gitlab at videolan.org
Thu Oct 26 10:58:17 CEST 2017
Hugo Beauzée-Luyssen pushed to branch master at videolan / libvlcpp
Commits:
a027be08 by Hugo Beauzée-Luyssen at 2017-10-26T10:58:01+02:00
Instance: win32: Use the secure flavor of vsnprintf
- - - - -
eb8dca85 by Hugo Beauzée-Luyssen at 2017-10-26T10:58:30+02:00
Instance: win32: Don't ignore potential sprintf_s errors
- - - - -
1 changed file:
- vlcpp/Instance.hpp
Changes:
=====================================
vlcpp/Instance.hpp
=====================================
--- a/vlcpp/Instance.hpp
+++ b/vlcpp/Instance.hpp
@@ -254,10 +254,12 @@ public:
#else
//MSVC treats passing nullptr as 1st vsnprintf(_s) as an error
char psz_msg[512];
- if ( vsnprintf(psz_msg, sizeof(psz_msg) - 1, format, va) < 0 )
+ if ( _vsnprintf_s( psz_msg, _TRUNCATE, format, va ) < 0 )
return;
char psz_ctx[1024];
- sprintf_s(psz_ctx, "[%s] (%s:%d) %s", psz_module, psz_file, i_line, psz_msg);
+ if( sprintf_s( psz_ctx, "[%s] (%s:%d) %s", psz_module, psz_file,
+ i_line, psz_msg ) < 0 )
+ return;
#endif
logCb( level, ctx, std::string{ psz_ctx } );
};
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/compare/4db4f8406f5a7d5f3d9d08f4a0b13affb0b2edd0...eb8dca85f888053eb7b25a2cf4db74bbae5180ca
---
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/compare/4db4f8406f5a7d5f3d9d08f4a0b13affb0b2edd0...eb8dca85f888053eb7b25a2cf4db74bbae5180ca
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list