summaryrefslogtreecommitdiff
path: root/src/htsrobots.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-03-19 12:51:31 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-03-19 12:51:31 +0000
commit25adbdabb47499fe641c7bd9595024ff82667058 (patch)
tree4200bb5e746bc1c0606de615ec99f0a247d4d9ba /src/htsrobots.c
parentad5b7acc19290ff91e0f42a0de448a26760fcf99 (diff)
httrack 3.30.1
Diffstat (limited to 'src/htsrobots.c')
-rw-r--r--src/htsrobots.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/htsrobots.c b/src/htsrobots.c
index 8aabdd4..58e97fb 100644
--- a/src/htsrobots.c
+++ b/src/htsrobots.c
@@ -79,10 +79,11 @@ int checkrobots(robots_wizard* robots,char* adr,char* fil) {
return 0;
}
int checkrobots_set(robots_wizard* robots,char* adr,char* data) {
- if (((int) strlen(data)) > 999) return 0;
+ if (((int) strlen(adr)) >= sizeof(robots->adr) - 2) return 0;
+ if (((int) strlen(data)) >= sizeof(robots->token) - 2) return 0;
while(robots) {
if (strfield2(robots->adr,adr)) { // entrée existe
- strcpy(robots->token,data);
+ strcpybuff(robots->token,data);
#if DEBUG_ROBOTS
printf("robots.txt: set %s to %s\n",adr,data);
#endif
@@ -92,8 +93,8 @@ int checkrobots_set(robots_wizard* robots,char* adr,char* data) {
robots->next=(robots_wizard*) calloct(1,sizeof(robots_wizard));
if (robots->next) {
robots->next->next=NULL;
- strcpy(robots->next->adr,adr);
- strcpy(robots->next->token,data);
+ strcpybuff(robots->next->adr,adr);
+ strcpybuff(robots->next->token,data);
#if DEBUG_ROBOTS
printf("robots.txt: new set %s to %s\n",adr,data);
#endif