openbsd-ports/sysutils/radmind/patches/patch-stor_c
2007-04-01 07:08:39 +00:00

19 lines
798 B
Plaintext

$OpenBSD: patch-stor_c,v 1.3 2007/04/01 07:08:39 steven Exp $
--- stor.c.orig Fri Oct 1 17:20:05 2004
+++ stor.c Sun Apr 1 08:18:32 2007
@@ -464,11 +464,13 @@ n_stor_applefile( SNET *sn, char *pathdesc, char *path
struct timeval tv;
struct applefileinfo afinfo;
off_t size;
+ size_t len;
/* Setup fake apple file info */
/* Finder Info */
memset( &afinfo, 0, sizeof( afinfo ));
- sprintf( afinfo.ai.ai_data + FI_CREATOR_OFFSET, "%s", "RDMD" );
+ len = sizeof( afinfo.ai.ai_data );
+ (void)snprintf( afinfo.ai.ai_data + FI_CREATOR_OFFSET, len - FI_CREATOR_OFFSET, "%s", "RDMD" );
afinfo.as_ents[AS_FIE].ae_id = ASEID_FINFO;
afinfo.as_ents[AS_FIE].ae_offset = AS_HEADERLEN +
( 3 * sizeof( struct as_entry )); /* 62 */