~ubuntu-branches/ubuntu/hardy/openssl/hardy-security

« back to all changes in this revision

Viewing changes to crypto/asn1/a_gentm.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2005-12-13 21:37:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051213213742-7em5nrw5c7ceegyd
Tags: 0.9.8a-5
Stop ssh from crashing randomly on sparc (Closes: #335912)
Patch from upstream cvs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
        return(0);
182
182
        }
183
183
 
184
 
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str)
 
184
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
185
185
        {
186
186
        ASN1_GENERALIZEDTIME t;
187
187
 
192
192
                {
193
193
                if (s != NULL)
194
194
                        {
195
 
                        ASN1_STRING_set((ASN1_STRING *)s,
196
 
                                (unsigned char *)str,t.length);
 
195
                        if (!ASN1_STRING_set((ASN1_STRING *)s,
 
196
                                (unsigned char *)str,t.length))
 
197
                                return 0;
197
198
                        s->type=V_ASN1_GENERALIZEDTIME;
198
199
                        }
199
200
                return(1);
223
224
        if ((p == NULL) || ((size_t)s->length < len))
224
225
                {
225
226
                p=OPENSSL_malloc(len);
226
 
                if (p == NULL) return(NULL);
 
227
                if (p == NULL)
 
228
                        {
 
229
                        ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_SET,
 
230
                                ERR_R_MALLOC_FAILURE);
 
231
                        return(NULL);
 
232
                        }
227
233
                if (s->data != NULL)
228
234
                        OPENSSL_free(s->data);
229
235
                s->data=(unsigned char *)p;