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

« back to all changes in this revision

Viewing changes to packages/OS400/os400sys.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:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: os400sys.c,v 1.4 2008-05-20 10:21:50 patrickm Exp $
 
21
 * $Id: os400sys.c,v 1.6 2008-09-24 12:22:17 yangtse Exp $
22
22
 *
23
23
 ***************************************************************************/
24
24
 
192
192
 
193
193
    /* Allocate buffer descriptors for the current thread. */
194
194
 
195
 
    if (!(bufs = (buffer_t *) calloc((size_t) LK_LAST, sizeof *bufs)))
 
195
    if (!(bufs = calloc((size_t) LK_LAST, sizeof *bufs)))
196
196
      return (char *) NULL;
197
197
 
198
198
    if (pthread_setspecific(thdkey, (void *) bufs)) {
220
220
  if (Curl_thread_buffer == buffer_undef) {     /* If unchanged during lock. */
221
221
    if (!pthread_key_create(&thdkey, thdbufdestroy))
222
222
      Curl_thread_buffer = buffer_threaded;
223
 
    else if (!(locbufs = (buffer_t *) calloc((size_t) LK_LAST,
 
223
    else if (!(locbufs = calloc((size_t) LK_LAST,
224
224
                                             sizeof *locbufs))) {
225
225
      pthread_mutex_unlock(&mutex);
226
226
      return (char *) NULL;
340
340
}
341
341
 
342
342
 
343
 
int
344
 
Curl_inet_ntoa_r_a(struct in_addr internet_address,
345
 
                   char * output_buffer, int output_buffer_length)
346
 
 
347
 
{
348
 
  int rc;
349
 
  int i;
350
 
  char * cp;
351
 
 
352
 
  if (!output_buffer || output_buffer_length < 16)
353
 
    return inet_ntoa_r(internet_address, output_buffer, output_buffer_length);
354
 
 
355
 
  if (!(cp = malloc(output_buffer_length + 1)))
356
 
    return -1;
357
 
 
358
 
  rc = inet_ntoa_r(internet_address, cp, output_buffer_length);
359
 
 
360
 
  if (rc) {
361
 
    free(cp);
362
 
    return rc;
363
 
    }
364
 
 
365
 
  cp[output_buffer_length - 1] = '\0';
366
 
  i = strlen(cp);
367
 
  QadrtConvertE2A(output_buffer, cp, i, i);
368
 
  output_buffer[i] = '\0';
369
 
  free(cp);
370
 
  return rc;
371
 
}
372
 
 
373
 
 
374
343
#ifdef USE_QSOSSL
375
344
 
376
345
/* ASCII wrappers for the SSL procedures. */
777
746
    for (i = 0; attrs[i++];)
778
747
      ;
779
748
 
780
 
    if (!(eattrs = (char * *) calloc(i, sizeof *eattrs)))
 
749
    if (!(eattrs = calloc(i, sizeof *eattrs)))
781
750
      status = LDAP_NO_MEMORY;
782
751
    else {
783
752
      for (j = 0; attrs[j]; j++) {