Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
69b8ec07
Commit
69b8ec07
authored
May 07, 1998
by
Klaas Freitag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More buffer overrun fixes.
parent
c545e76b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
arp.c
arp.c
+7
-4
lib/getargs.c
lib/getargs.c
+1
-1
No files found.
arp.c
View file @
69b8ec07
...
...
@@ -111,7 +111,8 @@ arp_del(char **args)
fprintf
(
stderr
,
NLS_CATGETS
(
catfd
,
arpSet
,
arp_hostname
,
"arp: need host name
\n
"
));
return
(
-
1
);
}
strcpy
(
host
,
*
args
);
host
[(
sizeof
host
)
-
1
]
=
0
;
strncpy
(
host
,
*
args
,
(
sizeof
host
)
-
1
);
if
(
ap
->
input
(
0
,
host
,
&
sa
)
<
0
)
{
ap
->
herror
(
host
);
return
(
-
1
);
...
...
@@ -306,7 +307,8 @@ arp_set(char **args)
fprintf
(
stderr
,
NLS_CATGETS
(
catfd
,
arpSet
,
arp_hostname
,
"arp: need host name
\n
"
));
return
(
-
1
);
}
strcpy
(
host
,
*
args
++
);
host
[(
sizeof
host
)
-
1
]
=
0
;
strncpy
(
host
,
*
args
++
,
(
sizeof
host
)
-
1
);
if
(
ap
->
input
(
0
,
host
,
&
sa
)
<
0
)
{
ap
->
herror
(
host
);
return
(
-
1
);
...
...
@@ -589,7 +591,8 @@ arp_show(char *name)
if
(
name
!=
NULL
)
{
/* Resolve the host name. */
strcpy
(
host
,
name
);
host
[(
sizeof
host
)
-
1
]
=
0
;
strncpy
(
host
,
name
,
(
sizeof
host
)
-
1
);
if
(
ap
->
input
(
0
,
host
,
&
sa
)
<
0
)
{
ap
->
herror
(
host
);
return
(
-
1
);
...
...
@@ -610,7 +613,7 @@ arp_show(char *name)
/* Read the ARP cache entries. */
for
(;
fgets
(
line
,
sizeof
(
line
),
fp
);)
{
num
=
sscanf
(
line
,
"%s 0x%x 0x%x %
s %s %
s
\n
"
,
num
=
sscanf
(
line
,
"%s 0x%x 0x%x %
100s %100s %100
s
\n
"
,
ip
,
&
type
,
&
flags
,
hwa
,
mask
,
dev
);
if
(
num
<
4
)
break
;
...
...
lib/getargs.c
View file @
69b8ec07
...
...
@@ -47,7 +47,7 @@ getargs(char *string, char *arguments[])
* Look for delimiters ("); if present whatever
* they enclose will be considered one argument.
*/
while
(
*
ptr
!=
'\0'
&&
i
<
3
2
)
{
while
(
*
ptr
!=
'\0'
&&
i
<
3
1
)
{
/* Ignore leading whitespace on input string. */
while
(
*
ptr
==
' '
||
*
ptr
==
'\t'
)
ptr
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment