Bug 2715 - comment buffer is very short
comment buffer is very short
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: nmbd
3.0.9
All Linux
: P3 normal
: none
Assigned To: Jeremy Allison
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-14 03:35 UTC by ISHIKAWA Tomonori
Modified: 2006-04-09 14:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ISHIKAWA Tomonori 2005-05-14 03:35:53 UTC
I think 'computer comment string' buffer is very short.
maximum number of characters in 'computer comment string' is 48 in the 
Windows2000. and Chinese, Japanese, Korean symbols in general need three UTF-8 
bytes.
thus, 'computer comment string' buffer needs 48 * 3 = 144 bytes.
here is a patch.

--- nmbd_incomingdgrams.c.orig  2005-05-14 19:09:39.000000000 +0900
+++ nmbd_incomingdgrams.c       2005-05-14 18:49:07.000000000 +0900
@@ -108,7 +108,8 @@
        START_PROFILE(host_announce);

        pull_ascii_fstring(comment, buf+31);
-       comment[42] = 0;
+//     comment[42] = 0;
+       comment[145] = 0;

        pull_ascii_nstring(announce_name, sizeof(announce_name), buf+5);
        pull_ascii_nstring(source_name, sizeof(source_name), dgram-
>source_name.name);
Comment 1 Gerald (Jerry) Carter 2006-04-08 23:11:57 UTC
Jeremy, please review this patch
Comment 2 Jeremy Allison 2006-04-09 14:39:49 UTC
Will be fixed for 3.0.23.
Thanks,
Jeremy.