Incorrect msprintf arguments make scilab crash
Reported by Serge STEER
BUG DESCRIPTION:
----------------
passing incorrect arguments to msprintf (too many data with respect to the format) makes Scilab crash
ERROR LOG:
----------
Une erreur fatale a été détectée par Scilab.
Veuillez vérifier les fonctions définies par l'utilisateur (ou celles des modules externes), elles devraient apparaître dans le suivi de la pile.
Ou sinon, vous pouvez reporter un bug sur http://bugzilla.scilab.org/ avec :
* un simple code qui reproduit le problème
* le résultat de [a, b] = getdebuginfo()
* l'information suivante :
[mir2:29116] Signal: Erreur de segmentation (11)
[mir2:29116] Signal code: Address not mapped (1)
[mir2:29116] Failing at address: 0x200000003
Pile d'appel :
1: 0x914da6 <JVM_handle_linux_signal> (/home/steer/git_scilab/master/scilab/java/jre1.8.0_51/lib/amd64/server/libjvm.so)
2: 0x90b6f3 < > (/home/steer/git_scilab/master/scilab/java/jre1.8.0_51/lib/amd64/server/libjvm.so)
3: 0x10b00 < > (/lib64/libpthread.so.0)
4: 0x9d660 <wcslen> (/lib64/libc.so.6)
5: 0x9d61e <wcsdup> (/lib64/libc.so.6)
6: 0x44a704 <types::String::set(wchar_t const* const*)> (/home/steer/git_scilab/master/scilab/modules/ast/.libs/libsciast.so.6)
7: 0x37a44d <sci_msprintf(std::vector<types::InternalType*, std::allocator<types::InternalType*> >&, int, std::vector<types::InternalType*, std::allocator<types::InternalType*> >&)> (/home/steer/git_scilab/master/scilab/modules/.libs/libscilab-cli.so.6)
8: 0x3f5e78 <types::Callable::invoke(std::vector<types::InternalType*, std::allocator<types::InternalType*> >&, std::unordered_map<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, types::InternalType*, std::hash<std::basic_string<wchar_> (/home/steer/git_scilab/master/scilab/modules/ast/.libs/libsciast.so.6)
9: 0x1d1e14 <ast::RunVisitorT<ast::ExecVisitor>::visitprivate(ast::CallExp const&)> (/home/steer/git_scilab/master/scilab/modules/ast/.libs/libsciast.so.6)
10: 0x1cc0fc <ast::RunVisitorT<ast::ExecVisitor>::visitprivate(ast::SeqExp const&)> (/home/steer/git_scilab/master/scilab/modules/ast/.libs/libsciast.so.6)
11: 0x1c1f69 <StaticRunner::launch()> (/home/steer/git_scilab/master/scilab/modules/.libs/libscilab-cli.so.6)
12: 0x1bba92 <RunScilabEngine> (/home/steer/git_scilab/master/scilab/modules/.libs/libscilab-cli.so.6)
13: 0x1c49 <main> (/home/steer/git_scilab/master/scilab/.libs/scilab-bin)
14: 0x206e5 <__libc_start_main> (/lib64/libc.so.6)
15: 0x21f9 < > (/home/steer/git_scilab/master/scilab/.libs/scilab-bin)
Fin de la pile
HOW TO REPRODUCE THE BUG:
-------------------------
z=[-1.7;-1.7];
wn=[1;1];
msprintf(_("Compensator pole\nDamping: %.3g\nNatural pulsation: %.3grd/s"),z,wn)
OTHER INFORMATION:
------------------
The following expression (\n at the format's end) works as expected
msprintf(_("Compensator pole\nDamping: %.3g\nNatural pulsation: %.3grd/s\n"),z,wn)