[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGABRT when testing md5sum.cc
From: |
jkirby |
Subject: |
Re: SIGABRT when testing md5sum.cc |
Date: |
Mon, 22 Nov 2010 19:40:17 -0800 (PST) |
I saw this crash on a msvc build. null-termination of sprintf not being
accounted for?
diff -r 521f2bb7c443 liboctave/oct-md5.cc
--- a/liboctave/oct-md5.cc Thu Nov 18 20:14:52 2010 -0500
+++ b/liboctave/oct-md5.cc Mon Nov 22 22:36:54 2010 -0500
@@ -36,7 +36,7 @@
static std::string
oct_md5_result_to_str (const unsigned char *buf)
{
- char tmp [32];
+ char tmp [32+1] = { 0 };
for (octave_idx_type i = 0; i < 16; i++)
sprintf (&tmp[2*i], "%02x", buf[i]);
--
View this message in context:
http://octave.1599824.n4.nabble.com/SIGABRT-when-testing-md5sum-cc-tp3052434p3054800.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.