[liblouis-liblouisxml] [liblouis] r1132 committed - Code to set unused end of outbuf to 0 to protect against bad applicati...

  • From: liblouis@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Mon, 31 Mar 2014 09:05:04 +0000

Revision: 1132
Author:   mwhapples@xxxxxxxxx
Date:     Mon Mar 31 09:04:50 2014 UTC
Log: Code to set unused end of outbuf to 0 to protect against bad applications not properly using outlen.

http://code.google.com/p/liblouis/source/detail?r=1132

Modified:
 /trunk/liblouis/lou_translateString.c

=======================================
--- /trunk/liblouis/lou_translateString.c       Wed Mar 12 14:47:47 2014 UTC
+++ /trunk/liblouis/lou_translateString.c       Mon Mar 31 09:04:50 2014 UTC
@@ -243,6 +243,11 @@
          else
            outbuf[k] = getCharFromDots (currentOutput[k]);
        }
+      // Blank the end of the translation buffer
+      for (k = dest; k < *outlen; k++)
+       {
+         outbuf[k] = 0;
+       }
       *inlen = realInlen;
       *outlen = dest;
       if (inputPositions != NULL)
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouis] r1132 committed - Code to set unused end of outbuf to 0 to protect against bad applicati... - liblouis