Skip to content

Instantly share code, notes, and snippets.

@Congee
Created February 27, 2015 08:15
Show Gist options
  • Save Congee/ff6b5b07614c51167f79 to your computer and use it in GitHub Desktop.
Save Congee/ff6b5b07614c51167f79 to your computer and use it in GitHub Desktop.
diff -urNad nbtscan-1.5.1~/nbtscan.c nbtscan-1.5.1/nbtscan.c
--- nbtscan-1.5.1~/nbtscan.c 2003-06-06 14:14:00.000000000 +0200
+++ nbtscan-1.5.1/nbtscan.c 2008-05-09 14:38:59.000000000 +0200
@@ -111,7 +111,7 @@
for(i=0; i< hostinfo->header->number_of_names; i++) {
service = hostinfo->names[i].ascii_name[15];
strncpy(name, hostinfo->names[i].ascii_name, 15);
- name[16]=0;
+ name[15]=0;
printf("%-17s Service: 0x%02x Flags: 0x%04x\n", name, service, hostinfo->names[i].rr_flags);
}
};
@@ -164,7 +164,7 @@
for(i=0; i< hostinfo->header->number_of_names; i++) {
service = hostinfo->names[i].ascii_name[15];
strncpy(name, hostinfo->names[i].ascii_name, 15);
- name[16]=0;
+ name[15]=0;
unique = !(hostinfo->names[i].rr_flags & 0x0080);
if(sf) {
printf("%s%s%s%s", inet_ntoa(addr), sf, name, sf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment