소스 검색

* Fix off-by-1 error in string in userfile processing

Bryan Drewery 17 년 전
부모
커밋
7ce31c204d
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/users.c

+ 1 - 1
src/users.c

@@ -626,7 +626,7 @@ int stream_readuserfile(bd::Stream& stream, struct userrec **ret)
   while (stream.tell() < stream.length()) {
     s = buf;
     str = stream.getline(sizeof(buf));
-    strlcpy(s, str.c_str(), std::min(str.length(), sizeof(buf)));
+    strlcpy(s, str.c_str(), std::min(str.length() + 1, sizeof(buf)));
     remove_crlf(s);
     if (1) {
       line++;