Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
8a58dc45
Commit
8a58dc45
authored
Oct 14, 2015
by
François Grisez
Browse files
Fix regex matching issue in the account creator
parent
d3bd19d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
coreapi/account_creator.c
coreapi/account_creator.c
+8
-2
No files found.
coreapi/account_creator.c
View file @
8a58dc45
...
...
@@ -170,8 +170,14 @@ static bool_t is_matching_regex(const char *entry, const char* regex) {
return
TRUE
;
#else
regex_t
regex_pattern
;
char
err_msg
[
256
];
int
res
;
regcomp
(
&
regex_pattern
,
regex
,
0
);
res
=
regcomp
(
&
regex_pattern
,
regex
,
REG_EXTENDED
|
REG_NOSUB
);
if
(
res
!=
REG_NOERROR
)
{
regerror
(
res
,
&
regex_pattern
,
err_msg
,
sizeof
(
err_msg
));
ms_error
(
"Could not compile regex '%s: %s"
,
regex
,
err_msg
);
return
FALSE
;
}
res
=
regexec
(
&
regex_pattern
,
entry
,
0
,
NULL
,
0
);
regfree
(
&
regex_pattern
);
return
(
res
!=
REG_NOMATCH
);
...
...
@@ -265,7 +271,7 @@ const char * linphone_account_creator_get_display_name(const LinphoneAccountCrea
}
LinphoneAccountCreatorStatus
linphone_account_creator_set_email
(
LinphoneAccountCreator
*
creator
,
const
char
*
email
)
{
if
(
!
is_matching_regex
(
email
,
".+@.+
\\
.[A-Za-z]{2}[A-Za-z]*"
))
{
if
(
!
is_matching_regex
(
email
,
"
^
.+@.+
\\
.[A-Za-z]{2}[A-Za-z]*
$
"
))
{
return
LinphoneAccountCreatorEmailInvalid
;
}
set_string
(
&
creator
->
email
,
email
);
...
...
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