提交 2e679780 编写于 作者: J Jim Meyering 提交者: Anthony Liguori

libcacard/vcard_emul_nss: use pstrcpy in place of strncpy

Replace strncpy+NUL-terminate use with use of pstrcpy.
This requires linking with cutils.o (or else vssclient doesn't link),
so add that in the Makefile.
Acked-by: NAlon Levy <alevy@redhat.com>
Signed-off-by: NJim Meyering <meyering@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 1ab516ed
......@@ -14,6 +14,9 @@ QEMU_CFLAGS+=-I../
libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o cutils.o
$(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
clean:
rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo */*.lo .libs/* */.libs/* *.la */*.la *.pc
rm -Rf .libs */.libs
......
......@@ -1169,8 +1169,7 @@ vcard_emul_options(const char *args)
NEXT_TOKEN(vname)
NEXT_TOKEN(type_params)
type_params_length = MIN(type_params_length, sizeof(type_str)-1);
strncpy(type_str, type_params, type_params_length);
type_str[type_params_length] = 0;
pstrcpy(type_str, type_params_length, type_params);
type = vcard_emul_type_from_string(type_str);
NEXT_TOKEN(type_params)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册