[Asterisk-code-review] app voicemail: Fix data-type mismatch between app voicemail ... (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Thu Mar 29 14:50:56 CDT 2018


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/8681 )

Change subject: app_voicemail: Fix data-type mismatch between app_voicemail and database
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/8681/2/apps/app_voicemail.c
File apps/app_voicemail.c:

https://gerrit.asterisk.org/#/c/8681/2/apps/app_voicemail.c@4286
PS2, Line 4286: 	msgnum = (int)strtol(data->msgnums, NULL, 10);
              : 	duration = (int)strtol(data->duration, NULL, 10);
              : 	origtime = (int)strtol(data->origtime, NULL, 10);
Conversions can be tricky. For instance, one has to either check for possible under/over flows and/or other potential conversion errors, or guarantee the input will not cause a problem.

It's doubtful these input values would be a problem, but is it possible for one to be out of range? If that does occur is the strtol possible return values acceptable in these cases?

Another option would be to use 'sscanf' to convert the values. It might make things slightly easier.



-- 
To view, visit https://gerrit.asterisk.org/8681
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I8543ad480a08c98be78bde1ee870e6e6c84b2c5b
Gerrit-Change-Number: 8681
Gerrit-PatchSet: 2
Gerrit-Owner: Nic Colledge <nic at njcolledge.net>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Thu, 29 Mar 2018 19:50:56 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180329/d4beb787/attachment.html>


More information about the asterisk-code-review mailing list