Skip to content

Commit

Permalink
afpd: use the safer strlcpy()
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark authored and slowfranklin committed Apr 11, 2023
1 parent 52ce07a commit 6a46ce0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion etc/afpd/spotlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <atalk/netatalk_conf.h>
#include <atalk/volume.h>
#include <atalk/spotlight.h>
#include <atalk/compat.h>

#include "directory.h"
#include "etc/spotlight/sparql_parser.h"
Expand Down Expand Up @@ -1435,7 +1436,7 @@ int afp_spotlight_rpc(AFPObj *obj, char *ibuf, size_t ibuflen,
RSIVAL(rbuf, 0, ntohs(vid));
RSIVAL(rbuf, 4, 0);
len = strlen(vol->v_path) + 1;
strncpy(rbuf + 8, vol->v_path, len);
strlcpy(rbuf + 8, vol->v_path, len);
*rbuflen += 8 + len;
break;

Expand Down

0 comments on commit 6a46ce0

Please sign in to comment.