~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/util/ss/parse.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
 
2
 * Copyright 2007 Massachusetts Institute of Technology.
 
3
 * All Rights Reserved.
 
4
 *
 
5
 * Export of this software from the United States of America may
 
6
 *   require a specific license from the United States Government.
 
7
 *   It is the responsibility of any person or organization contemplating
 
8
 *   export to obtain such a license before exporting.
 
9
 * 
 
10
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
 
11
 * distribute this software and its documentation for any purpose and
 
12
 * without fee is hereby granted, provided that the above copyright
 
13
 * notice appear in all copies and that both that copyright notice and
 
14
 * this permission notice appear in supporting documentation, and that
 
15
 * the name of M.I.T. not be used in advertising or publicity pertaining
 
16
 * to distribution of the software without specific, written prior
 
17
 * permission.  Furthermore if you modify this software you must label
 
18
 * your software as modified software and not distribute it in such a
 
19
 * fashion that it might be confused with the original M.I.T. software.
 
20
 * M.I.T. makes no representations about the suitability of
 
21
 * this software for any purpose.  It is provided "as is" without express
 
22
 * or implied warranty.
 
23
 */
 
24
/*
2
25
 * Copyright 1987, 1988 by MIT Student Information Processing Board
3
26
 *
4
27
 * For copyright info, see copyright.h.
23
46
 *              Where to put the "argc" (number of tokens) value.
24
47
 * Returns:
25
48
 *      argv (char **)
26
 
 *              Series of pointers to parsed tokens.
 
49
 *              Series of pointers to parsed tokens in the original string.
27
50
 */
28
51
 
29
52
#define NEW_ARGV(old,n) (char **)realloc((char *)old,\
35
58
    int *argc_ptr;
36
59
{
37
60
    register char **argv, *cp;
 
61
    char **newargv;
38
62
    register int argc;
39
63
    register enum parse_mode parse_mode;
40
64
 
67
91
                /* go to quoted-string mode */
68
92
                parse_mode = QUOTED_STRING;
69
93
                cp = line_ptr++;
70
 
                argv = NEW_ARGV (argv, argc);
 
94
                newargv = NEW_ARGV (argv, argc);
 
95
                if (newargv == NULL) {
 
96
                out_of_mem_in_argv:
 
97
                    free(argv);
 
98
                    ss_error(sci_idx, errno, "Can't allocate storage");
 
99
                    *argc_ptr = 0;
 
100
                    return NULL;
 
101
                }
 
102
                argv = newargv;
71
103
                argv[argc++] = cp;
72
104
                argv[argc] = NULL;
73
105
            }
75
107
                /* random-token mode */
76
108
                parse_mode = TOKEN;
77
109
                cp = line_ptr;
78
 
                argv = NEW_ARGV (argv, argc);
 
110
                newargv = NEW_ARGV (argv, argc);
 
111
                if (newargv == NULL)
 
112
                    goto out_of_mem_in_argv;
 
113
                argv = newargv;
79
114
                argv[argc++] = line_ptr;
80
115
                argv[argc] = NULL;
81
116
            }