- djm@cvs.openbsd.org 2010/03/04 01:44:57

[key.c]
     use buffer_get_string_ptr_ret() where we are checking the return
     value explicitly instead of the fatal()-causing buffer_get_string_ptr()
This commit is contained in:
Damien Miller 2010-03-04 21:52:18 +11:00
parent fe588e3c84
commit 2befbad9b3
2 changed files with 7 additions and 3 deletions

View File

@ -18,6 +18,10 @@
- djm@cvs.openbsd.org 2010/03/03 22:50:40 - djm@cvs.openbsd.org 2010/03/03 22:50:40
[PROTOCOL.certkeys] [PROTOCOL.certkeys]
s/similar same/similar/; from imorgan AT nas.nasa.gov s/similar same/similar/; from imorgan AT nas.nasa.gov
- djm@cvs.openbsd.org 2010/03/04 01:44:57
[key.c]
use buffer_get_string_ptr_ret() where we are checking the return
value explicitly instead of the fatal()-causing buffer_get_string_ptr()
20100303 20100303
- (djm) [PROTOCOL.certkeys] Add RCS Ident - (djm) [PROTOCOL.certkeys] Add RCS Ident

6
key.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: key.c,v 1.84 2010/03/03 01:44:36 djm Exp $ */ /* $OpenBSD: key.c,v 1.85 2010/03/04 01:44:57 djm Exp $ */
/* /*
* read_bignum(): * read_bignum():
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -1069,8 +1069,8 @@ cert_parse(Buffer *b, Key *key, const u_char *blob, u_int blen)
buffer_append(&tmp, constraints, clen); buffer_append(&tmp, constraints, clen);
/* validate structure */ /* validate structure */
while (buffer_len(&tmp) != 0) { while (buffer_len(&tmp) != 0) {
if (buffer_get_string_ptr(&tmp, NULL) == NULL || if (buffer_get_string_ptr_ret(&tmp, NULL) == NULL ||
buffer_get_string_ptr(&tmp, NULL) == NULL) { buffer_get_string_ptr_ret(&tmp, NULL) == NULL) {
error("%s: Constraints data invalid", __func__); error("%s: Constraints data invalid", __func__);
goto out; goto out;
} }