projects
/
asterisk/asterisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
731dccf
)
Fix the segfault in get_calleridname if the From: string starts with "<sip:..."
author
Martin Pycko
<martinp@digium.com>
Sun, 8 Jun 2003 16:26:08 +0000
(16:26 +0000)
committer
Martin Pycko
<martinp@digium.com>
Sun, 8 Jun 2003 16:26:08 +0000
(16:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1079
65c4cc65
-6c06-0410-ace0-
fbb531ad65f3
channels/chan_sip.c
patch
|
blob
|
history
diff --git
a/channels/chan_sip.c
b/channels/chan_sip.c
index
5c14899
..
58ef453
100755
(executable)
--- a/
channels/chan_sip.c
+++ b/
channels/chan_sip.c
@@
-3326,7
+3326,7
@@
static char *get_calleridname(char *input,char *output)
{
char *end = strchr(input,'<');
char *tmp = strchr(input,'\"');
- if (!end) return NULL;
+ if (!end || (end == input)) return NULL;
/* move away from "<" */
end--;
/* we found "name" */
@@
-3342,7
+3342,10
@@
static char *get_calleridname(char *input,char *output)
/* clear the empty characters in the end */
while(*end && (*end < 33) && end > input)
end--;
- strncpy(output,input,(int)(end-input));
+ if (end > input)
+ strncpy(output,input,(int)(end-input));
+ else
+ output = NULL;
}
return output;
}