Return-Path: X-Original-To: rt@krbdev.mit.edu Received: from arioch.imrryr.org (arioch.imrryr.org [38.117.134.205]) by krbdev.mit.edu (Postfix) with ESMTP id 708F9CCF1A for ; Wed, 22 Apr 2009 16:23:07 +0000 (UTC) Received: from imrryr.org (localhost [127.0.0.1]) by arioch.imrryr.org (Postfix) with ESMTP id 1325D37018 for ; Wed, 22 Apr 2009 12:22:46 -0400 (EDT) To: rt@krbdev.mit.edu Subject: Re: [krbdev.mit.edu #6475] Adding keys to malformed keytabs can infinitely extend the file In-Reply-To: Your message of "Wed, 22 Apr 2009 16:17:49 -0000." Organization: The Fall of Imrryr User-Agent: nmh-1.0.4 (NetBSD/alpha) X-Copyright: Copyright 2009, R. C. Dowdeswell. All Rights Reserved. X-Window-System: Release 6.3 Date: Wed, 22 Apr 2009 12:22:46 -0400 From: Roland Dowdeswell Message-ID: <20090422162246.1325D37018@arioch.imrryr.org> RT-Send-Cc: X-RT-Original-Encoding: iso-8859-1 Content-Length: 662 On 1240417069 seconds since the Beginning of the UNIX epoch "krb5" wrote: > >+ bufsiz = (*size_needed + sizeof(krb5_int32)); As it turns out, I made a quite similar mistake. This line should actually be: bufsiz = (*size_needed + sizeof(krb5_int32)) - size; In order to take care of what we've already written. It might also be better to just fseek(3) out to the right place and slap the sizeof(krb5_int32) zeros in place and fseek(3) back to where we originally were. That would be much more clear but I didn't read the standards to see if that would be properly portable. -- Roland Dowdeswell http://Imrryr.ORG/~elric/