aboutsummaryrefslogtreecommitdiffstats
path: root/g10/build-packet.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-04-23 21:18:39 +0000
committerDavid Shaw <[email protected]>2003-04-23 21:18:39 +0000
commit874214d0a0a0754d8fc48e57b066c778d3869e44 (patch)
treec2176ae3e2181f4069acf0652513e18261f4493b /g10/build-packet.c
parent* Makefile.am, options.in: Rename options.in to options since it no longer (diff)
downloadgnupg-874214d0a0a0754d8fc48e57b066c778d3869e44.tar.gz
gnupg-874214d0a0a0754d8fc48e57b066c778d3869e44.zip
* import.c (import_revoke_cert): Remove ultimate trust when revoking an
ultimately trusted key. * keyedit.c (sign_uids): Allow replacing expired signatures. Allow duplicate signatures with --expert. * pkclist.c (check_signatures_trust): Don't display a null fingerprint when checking a signature with --always-trust enabled. * filter.h (progress_filter_context_t), progress.c (handle_progress), plaintext.c (ask_for_detached_datafile, hash_datafiles): Fix compiler warnings. Make "what" constant. * build-packet.c (do_plaintext): Do not create invalid literal packets with >255-byte names.
Diffstat (limited to 'g10/build-packet.c')
-rw-r--r--g10/build-packet.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/g10/build-packet.c b/g10/build-packet.c
index 269cca304..92e357f7e 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -1,5 +1,6 @@
/* build-packet.c - assemble packets and write them
- * Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002,
+ * 2003 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -539,6 +540,12 @@ do_plaintext( IOBUF out, int ctb, PKT_plaintext *pt )
byte buf[1000]; /* this buffer has the plaintext! */
int nbytes;
+ /* Truncate namelen to the maximum 255 characters. This does mean
+ that a function that calls build_packet with an illegal literal
+ packet will get it back legalized. */
+ if(pt->namelen>255)
+ pt->namelen=255;
+
write_header(out, ctb, calc_plaintext( pt ) );
iobuf_put(out, pt->mode );
iobuf_put(out, pt->namelen );