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

« back to all changes in this revision

Viewing changes to lib/strerror.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-12 15:04:52 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20051212150452-2ymlra67b2p7kjyy
Tags: 7.15.1-1ubuntu1
Resynchronise with Debian to get URL parser overflow fix from 7.15.1
(CVE-2005-4077).

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "setup.h"
24
24
 
 
25
#ifdef HAVE_STRERROR_R
 
26
#if !defined(HAVE_POSIX_STRERROR_R) && !defined(HAVE_GLIBC_STRERROR_R)
 
27
#error "you MUST have either POSIX or glibc strerror_r if strerror_r is found"
 
28
#endif /* !POSIX && !glibc */
 
29
#endif /* HAVE_STRERROR_R */
 
30
 
25
31
#include <curl/curl.h>
26
32
#include <stdlib.h>
27
33
#include <string.h>
36
42
#define _MPRINTF_REPLACE /* use our functions only */
37
43
#include <curl/mprintf.h>
38
44
 
39
 
#ifdef HAVE_NO_STRERROR_R_DECL
 
45
#if defined(HAVE_STRERROR_R) && defined(HAVE_NO_STRERROR_R_DECL)
40
46
#ifdef HAVE_POSIX_STRERROR_R
41
47
/* seen on AIX 5100-02 gcc 2.9 */
42
48
extern int strerror_r(int errnum, char *strerrbuf, size_t buflen);
63
69
    return "URL using bad/illegal format or missing URL";
64
70
 
65
71
  case CURLE_COULDNT_RESOLVE_PROXY:
66
 
    return "couldnt resolve proxy name";
 
72
    return "couldn't resolve proxy name";
67
73
 
68
74
  case CURLE_COULDNT_RESOLVE_HOST:
69
 
    return "couldnt resolve host name";
 
75
    return "couldn't resolve host name";
70
76
 
71
77
  case CURLE_COULDNT_CONNECT:
72
78
    return "couldn't connect to server";
239
245
  case CURLE_LOGIN_DENIED:
240
246
    return "FTP: login denied";;
241
247
 
 
248
  case CURLE_TFTP_NOTFOUND:
 
249
    return "TFTP: File Not Found";;
 
250
 
 
251
  case CURLE_TFTP_PERM:
 
252
    return "TFTP: Access Violation";;
 
253
 
 
254
  case CURLE_TFTP_DISKFULL:
 
255
    return "TFTP: Disk full or allocation exceeded";;
 
256
 
 
257
  case CURLE_TFTP_ILLEGAL:
 
258
    return "TFTP: Illegal operation";;
 
259
 
 
260
  case CURLE_TFTP_UNKNOWNID:
 
261
    return "TFTP: Unknown transfer ID";;
 
262
 
 
263
  case CURLE_TFTP_EXISTS:
 
264
    return "TFTP: File already exists";;
 
265
 
 
266
  case CURLE_TFTP_NOSUCHUSER:
 
267
    return "TFTP: No such user";;
 
268
 
242
269
  case CURLE_URL_MALFORMAT_USER: /* not used by current libcurl */
243
270
  case CURLE_MALFORMAT_USER:     /* not used by current libcurl */
244
271
  case CURLE_BAD_CALLING_ORDER:  /* not used by current libcurl */
486
513
    p = "Winsock library is not ready";
487
514
    break;
488
515
  case WSANOTINITIALISED:
489
 
    p = "Winsock library not initalised";
 
516
    p = "Winsock library not initialised";
490
517
    break;
491
518
  case WSAVERNOTSUPPORTED:
492
519
    p = "Winsock version not supported.";