Revision: 1132 Author: mwhapples@xxxxxxxxx Date: Mon Mar 31 09:04:50 2014 UTCLog: 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