Index: b/g10/build-packet.c =================================================================== --- b/g10/build-packet.c +++ b/g10/build-packet.c @@ -1215,7 +1215,22 @@ /**************** - * calculate the length of a header + * calculate the length of a header. + * + * LEN is the length of the packet's body. NEW_CTB is whether we are + * using a new or old format packet. + * + * If LEN is 0 and NEW_CTB is 0, then we return a length that is + * appropriate for a body of indeterminate length. + * + * Note: it is not possible to compute the length of the header for + * packets whose body's length is 0 (this is not illegal, this is + * simply a limitation of the implementation). + * + * Note: if LEN is 0 and NEW_CTB is 1, this function will return 1, + * however, this is incorrect! Thus, do not call this function with + * these parameters. (Currently, no caller does this. So, if you + * need this functionality, first fix this implementation.) */ static int calc_header_length( u32 len, int new_ctb )