Skip to content
Snippets Groups Projects
Commit a3ce0707 authored by rswindell's avatar rswindell
Browse files

Added bounds checking to strip_ctrl and strip_exascii functions.

parent d8525301
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,7 @@ char* DLLCALL strip_ctrl(char *str)
char tmp[1024];
int i,j;
for(i=j=0;str[i];i++)
for(i=j=0;str[i] && j<sizeof(tmp)-1;i++)
if(str[i]==CTRL_A)
i++;
else if((uchar)str[i]>=SP)
......@@ -154,7 +154,7 @@ char* DLLCALL strip_exascii(char *str)
char tmp[1024];
int i,j;
for(i=j=0;str[i];i++)
for(i=j=0;str[i] && j<sizeof(tmp)-1;i++)
if(!(str[i]&0x80))
tmp[j++]=str[i];
tmp[j]=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment