2014-09-09 14:51:18 +00:00
|
|
|
Index: extras/htpasswd.c
|
|
|
|
===================================================================
|
2018-10-23 12:47:01 +00:00
|
|
|
--- extras/htpasswd.c.orig 2018-10-22 10:48:47.811465609 +0200
|
|
|
|
+++ extras/htpasswd.c 2018-10-22 10:52:45.008744706 +0200
|
|
|
|
@@ -193,7 +193,8 @@ int main(int argc, char *argv[]) {
|
2007-01-15 23:39:05 +00:00
|
|
|
putline(tfp,line);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- strcpy(l,line);
|
|
|
|
+ strncpy(l,line,MAX_STRING_LEN);
|
|
|
|
+ l[MAX_STRING_LEN-1]='\0';
|
|
|
|
getword(w,l,':');
|
|
|
|
if(strcmp(user,w)) {
|
|
|
|
putline(tfp,line);
|
2018-10-23 12:47:01 +00:00
|
|
|
@@ -211,7 +212,8 @@ int main(int argc, char *argv[]) {
|
2007-01-15 23:39:05 +00:00
|
|
|
}
|
|
|
|
fclose(f);
|
|
|
|
fclose(tfp);
|
|
|
|
- sprintf(command,"cp %s %s",temp_template,argv[1]);
|
|
|
|
+ snprintf(command,MAX_STRING_LEN,"cp %s %s",temp_template,argv[1]);
|
|
|
|
+ command[MAX_STRING_LEN-1]='\0';
|
|
|
|
system(command);
|
|
|
|
unlink(temp_template);
|
|
|
|
exit(0);
|