]> git.webhop.me Git - shellexec.git/commitdiff
- shellexec: fix crashes while string formatting
authorsvenhoefer <svenhoefer@svenhoefer.com>
Wed, 4 Nov 2015 09:57:13 +0000 (10:57 +0100)
committersvenhoefer <svenhoefer@svenhoefer.com>
Wed, 4 Nov 2015 09:57:13 +0000 (10:57 +0100)
text.c

diff --git a/text.c b/text.c
index e6a917b52e5c3a1aa5bc0587efabe69656433ac5..a79a03fdeac3abd58eac64ead24039ac9a765ded 100644 (file)
--- a/text.c
+++ b/text.c
@@ -25,7 +25,7 @@ char rc,*rptr=src,*tptr=src;
                        ++rptr;
                        rc=*rptr;
                        found=0;
-                       for(i=0; i<sizeof(sc) && !found; i++)
+                       for(i=0; i<sizeof(sc)/sizeof(sc[0]) && !found; i++)
                        {
                                if(rc==sc[i])
                                {
@@ -49,7 +49,7 @@ char rc,*rptr=src,*tptr=src;
                        if (!quota && *rptr==0xC3 && *(rptr+1))
                        {
                                found=0;
-                               for(i=0; i<sizeof(su) && !found; i++)
+                               for(i=0; i<sizeof(su)/sizeof(su[0]) && !found; i++)
                                {
                                        if(*(rptr+1)==su[i])
                                        {
@@ -213,7 +213,7 @@ int GetStringLen(int sx, unsigned char *string, int size)
                                else
                                {
                                        found=0;
-                                       for(i=0; i<sizeof(sc) && !found; i++)
+                                       for(i=0; i<sizeof(sc)/sizeof(sc[0]) && !found; i++)
                                        {
                                                if(*string==sc[i])
                                                {