mirror of
https://github.com/curl/curl.git
synced 2026-07-28 19:33:07 +03:00
parent
60580f9f21
commit
3ecba2decd
1 changed files with 14 additions and 8 deletions
|
|
@ -45,17 +45,17 @@ struct set {
|
||||||
UNITTEST_START
|
UNITTEST_START
|
||||||
#ifdef USE_SSH
|
#ifdef USE_SSH
|
||||||
{
|
{
|
||||||
#define LONG_A "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
/* 60 a's */
|
||||||
#define LONG_AA LONG_A LONG_A LONG_A LONG_A LONG_A LONG_A LONG_A LONG_A LONG_A
|
#define SA60 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||||
#define LONG_AAA LONG_AA LONG_AA LONG_AA LONG_AA LONG_AA LONG_AA LONG_AA
|
/* 540 a's */
|
||||||
#define LONG_AAAA LONG_AAA LONG_AAA LONG_AAA LONG_AAA LONG_AAA LONG_AAA
|
#define SA540 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60
|
||||||
#define LONG_AAAAA LONG_AAAA LONG_AAAA LONG_AAAA LONG_AAAA
|
|
||||||
int i;
|
int i;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
size_t too_long = 90720;
|
||||||
struct set list[] = {
|
struct set list[] = {
|
||||||
{ LONG_AAAAA " b", "", "", "", CURLE_TOO_LARGE},
|
{ "-too-long-", "", "", "", CURLE_TOO_LARGE},
|
||||||
{ LONG_AA " c", LONG_AA, "c", "/", CURLE_OK},
|
{ SA540 " c", SA540, "c", "/", CURLE_OK},
|
||||||
{ "\" " LONG_AA "\" c", " " LONG_AA, "c", "/", CURLE_OK},
|
{ "\" " SA540 "\" c", " " SA540, "c", "/", CURLE_OK},
|
||||||
{ "a a", "a", "a", "/home/", CURLE_OK},
|
{ "a a", "a", "a", "/home/", CURLE_OK},
|
||||||
{ "b a", "b", "a", "/", CURLE_OK},
|
{ "b a", "b", "a", "/", CURLE_OK},
|
||||||
{ "a", "a", "", "/home/", CURLE_OK},
|
{ "a", "a", "", "/home/", CURLE_OK},
|
||||||
|
|
@ -73,6 +73,10 @@ UNITTEST_START
|
||||||
{ NULL, NULL, NULL, NULL, CURLE_OK }
|
{ NULL, NULL, NULL, NULL, CURLE_OK }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
list[0].cp = calloc(1, too_long + 1);
|
||||||
|
fail_unless(list[0].cp, "could not alloc too long value");
|
||||||
|
memset((void *)list[0].cp, 'a', too_long);
|
||||||
|
|
||||||
for(i = 0; list[i].home; i++) {
|
for(i = 0; list[i].home; i++) {
|
||||||
char *path;
|
char *path;
|
||||||
const char *cp = list[i].cp;
|
const char *cp = list[i].cp;
|
||||||
|
|
@ -98,6 +102,8 @@ UNITTEST_START
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free((void *)list[0].cp);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue