Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 706830 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/files.c (-5 / +5 lines)
Lines 70-76 char **textlist(char *textfile) { Link Here
70
70
71
	/* MEMWATCH: this isnt freed, why? */
71
	/* MEMWATCH: this isnt freed, why? */
72
	wordlist[count] = malloc_w(sizeof(NULL));
72
	wordlist[count] = malloc_w(sizeof(NULL));
73
	wordlist[count] = (char)NULL;
73
	wordlist[count] = NULL;
74
74
75
	fclose(fp);
75
	fclose(fp);
76
76
Lines 83-89 char **copy_list(char **list) { Link Here
83
	char **n_list; /* new list */
83
	char **n_list; /* new list */
84
84
85
	/* find num of elements */
85
	/* find num of elements */
86
	while (list[i] != (char)NULL) 
86
	while (list[i] != NULL)
87
		i++;
87
		i++;
88
	/* plus one for NULL */
88
	/* plus one for NULL */
89
	i++;
89
	i++;
Lines 91-102 char **copy_list(char **list) { Link Here
91
	n_list = malloc_w(i*sizeof(char*));
91
	n_list = malloc_w(i*sizeof(char*));
92
92
93
	i=0;
93
	i=0;
94
	while (list[i] != (char)NULL) {
94
	while (list[i] != NULL) {
95
		n_list[i] = (char*)strdup_w(list[i]);
95
		n_list[i] = (char*)strdup_w(list[i]);
96
		i++;
96
		i++;
97
	}
97
	}
98
98
99
	n_list[i] = (char)NULL;
99
	n_list[i] = NULL;
100
100
101
	return (n_list);
101
	return (n_list);
102
}
102
}
Lines 104-110 char **copy_list(char **list) { Link Here
104
void free_list(char **list) {
104
void free_list(char **list) {
105
	int i=0;
105
	int i=0;
106
106
107
	while (list[i] != (char)NULL) {
107
	while (list[i] != NULL) {
108
		free(list[i]);
108
		free(list[i]);
109
		i++;
109
		i++;
110
	}
110
	}
(-)a/src/http.c (-4 lines)
Lines 40-46 int submit(char *username, char *password) { Link Here
40
	CURLcode result;
40
	CURLcode result;
41
	char error[CURL_ERROR_SIZE] = "";
41
	char error[CURL_ERROR_SIZE] = "";
42
	char authstring[92];
42
	char authstring[92];
43
	time_t before, after;
44
43
45
	
44
	
46
	num_connects++;
45
	num_connects++;
Lines 59-66 int submit(char *username, char *password) { Link Here
59
	} else
58
	} else
60
		printf("trying %s->%s\n", username, password);
59
		printf("trying %s->%s\n", username, password);
61
60
62
	before = time(0);
63
64
	if (curl) {
61
	if (curl) {
65
		curl_easy_setopt(curl, CURLOPT_URL, url);
62
		curl_easy_setopt(curl, CURLOPT_URL, url);
66
		curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error);
63
		curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error);
Lines 79-85 int submit(char *username, char *password) { Link Here
79
		result = curl_easy_perform(curl);
76
		result = curl_easy_perform(curl);
80
	}
77
	}
81
78
82
	after = time(0);
83
	/* num_connects jumps the gun earlier on */
79
	/* num_connects jumps the gun earlier on */
84
//	acs = stats(acs, after-before, num_connects-1);
80
//	acs = stats(acs, after-before, num_connects-1);
85
81
(-)a/src/methods.c (-3 / +2 lines)
Lines 76-82 char *transform(char *username, char *password) { Link Here
76
76
77
	strncpy(old_password, password, sizeof(char)*41);
77
	strncpy(old_password, password, sizeof(char)*41);
78
78
79
	while ((cur_element = elements[i]) != (char)NULL) {
79
	while ((cur_element = elements[i]) != NULL) {
80
		if (!strcmp(password, "{username}"))
80
		if (!strcmp(password, "{username}"))
81
			strncpy(insertion, username, sizeof(insertion));
81
			strncpy(insertion, username, sizeof(insertion));
82
		else if (!strcmp(password, "{emanresu}"))
82
		else if (!strcmp(password, "{emanresu}"))
Lines 120-126 void common_pairs(void) { Link Here
120
	}
120
	}
121
121
122
	while (1) {
122
	while (1) {
123
		if (common_pairs_list[i] == (char)NULL)
123
		if (common_pairs_list[i] == NULL)
124
			break;
124
			break;
125
		strncpy(username, common_pairs_list[i], sizeof(char)*81);
125
		strncpy(username, common_pairs_list[i], sizeof(char)*81);
126
		password = extract(username, ':');
126
		password = extract(username, ':');
127
- 

Return to bug 706830