~ubuntu-branches/ubuntu/lucid/curl/lucid-security

« back to all changes in this revision

Viewing changes to tests/libtest/lib554.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-04-29 11:10:29 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090429111029-2j5eiyokfw2bw049
Tags: 7.19.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* drop debian/patches/security_CVE-2009-0037.patch 
  - this patch is part of 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: lib554.c,v 1.3 2008-05-22 21:49:53 danf Exp $
 
8
 * $Id: lib554.c,v 1.5 2008-09-20 04:26:57 yangtse Exp $
9
9
 */
10
10
 
11
11
#include "test.h"
12
12
 
 
13
#include "memdebug.h"
 
14
 
13
15
static char data[]="this is what we post to the silly web server\n";
14
16
 
15
17
struct WriteThis {
44
46
  struct curl_httppost *lastptr=NULL;
45
47
  struct WriteThis pooh;
46
48
 
 
49
  if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
 
50
    fprintf(stderr, "curl_global_init() failed\n");
 
51
    return TEST_ERR_MAJOR_BAD;
 
52
  }
 
53
 
47
54
  pooh.readptr = data;
48
55
  pooh.sizeleft = strlen(data);
49
56
 
50
 
  curl_global_init(CURL_GLOBAL_ALL);
51
 
 
52
57
  /* Fill in the file upload field */
53
58
  formrc = curl_formadd(&formpost,
54
59
                        &lastptr,
81
86
  if(formrc)
82
87
    printf("curl_formadd(3) = %d\n", (int)formrc);
83
88
 
84
 
  if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
85
 
    fprintf(stderr, "curl_global_init() failed\n");
86
 
    return TEST_ERR_MAJOR_BAD;
87
 
  }
88
 
 
89
89
  if ((curl = curl_easy_init()) == NULL) {
90
90
    fprintf(stderr, "curl_easy_init() failed\n");
 
91
    curl_formfree(formpost);
91
92
    curl_global_cleanup();
92
93
    return TEST_ERR_MAJOR_BAD;
93
94
  }