Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184121
b: refs/heads/master
c: a928852
h: refs/heads/master
i:
  184119: ec3759f
v: v3
  • Loading branch information
andrew hendry authored and David S. Miller committed Feb 16, 2010
1 parent 0066e02 commit 9838da0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b18e7a06857833d2c7c8c8457e5a3a7c3327f643
refs/heads/master: a9288525d2aed806c1b8a785c226d4a9e6371650
11 changes: 10 additions & 1 deletion trunk/net/x25/af_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <linux/notifier.h>
#include <linux/init.h>
#include <linux/compat.h>
#include <linux/ctype.h>

#include <net/x25.h>
#include <net/compat.h>
Expand Down Expand Up @@ -648,7 +649,7 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sock *sk = sock->sk;
struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr;
int rc = 0;
int len, i, rc = 0;

lock_kernel();
if (!sock_flag(sk, SOCK_ZAPPED) ||
Expand All @@ -658,6 +659,14 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out;
}

len = strlen(addr->sx25_addr.x25_addr);
for (i = 0; i < len; i++) {
if (!isdigit(addr->sx25_addr.x25_addr[i])) {
rc = -EINVAL;
goto out;
}
}

x25_sk(sk)->source_addr = addr->sx25_addr;
x25_insert_socket(sk);
sock_reset_flag(sk, SOCK_ZAPPED);
Expand Down

0 comments on commit 9838da0

Please sign in to comment.