A couple more off-by-one calculations with strlcpy.
authorJeremy Allison <jra@samba.org>
Fri, 6 May 2011 14:54:18 +0000 (07:54 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 6 May 2011 16:39:17 +0000 (18:39 +0200)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri May  6 18:39:17 CEST 2011 on sn-devel-104

source3/groupdb/mapping_tdb.c

index 60cdbf1..a5fa1b7 100644 (file)
@@ -901,10 +901,10 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key,
                                }
                        } else if (StrCaseCmp(name, "ntname") == 0) {
                                strlcpy(map.nt_name, val,
-                                       sizeof(map.nt_name) -1);
+                                       sizeof(map.nt_name));
                        } else if (StrCaseCmp(name, "comment") == 0) {
                                strlcpy(map.comment, val,
-                                       sizeof(map.comment) -1);
+                                       sizeof(map.comment));
                        } else if (StrCaseCmp(name, "member") == 0) {
                                if (!string_to_sid(&members[j], val)) {
                                        errno = EIO;