[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH (speechd-up) 1/2] Insure that text is NUL-terminated before speak

From: Christopher Brannon
Subject: [PATCH (speechd-up) 1/2] Insure that text is NUL-terminated before speaking it.
Date: Wed, 17 Feb 2010 10:14:04 -0600

In parse_buf, if text preceded a command, speak was called to render
it.  However, the text was not NUL-terminated.
So suppose we get the string \x01+3pX\x01-3p
That renders the x, with a pitch increment preceding it and a pitch
decrement succeeding it.  But the string X is not NUL-terminated.
Have you heard any odd characters when you try to read capital letters,
for example?  This is the cause.
 speechd-up.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/speechd-up.c b/speechd-up.c
index 1cf7aa0..532bd14 100644
--- a/speechd-up.c
+++ b/speechd-up.c
@@ -557,6 +557,7 @@ parse_buf(char *buf, size_t bytes)
             /* If there is some text before this command, say it */
             if (m > 0)
+              *po = '\0';
               LOG(5, "text: |%s|", text);
               LOG(5, "[speaking (2)]");

reply via email to

[Prev in Thread] Current Thread [Next in Thread]