projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41c0dca
)
getenv can return NULL
author
aland
<aland>
Mon, 7 Jul 2003 15:47:54 +0000
(15:47 +0000)
committer
aland
<aland>
Mon, 7 Jul 2003 15:47:54 +0000
(15:47 +0000)
Patch from Steve G
src/lib/missing.c
patch
|
blob
|
history
diff --git
a/src/lib/missing.c
b/src/lib/missing.c
index
fa970eb
..
1415fdb
100644
(file)
--- a/
src/lib/missing.c
+++ b/
src/lib/missing.c
@@
-91,7
+91,7
@@
int gethostname(char *name, int len)
char *h;
h = getenv("HOSTNAME");
- if (
strlen(h) + 1 > len
)
+ if (
!h || (strlen(h) + 1 > len)
)
return -1;
strcpy(name, h);
return 0;