Commit Graph

36 Commits

Author SHA1 Message Date
Richard Mudgett 186db8fdaf Fix some uninitialized buffers for CDR handling valgrind found.
* Made ast_strftime_locale() ensure that the output buffer is initialized.
The std library strftime() returns 0 and does not touch the buffer if it
has an error.  However, the function can also return 0 without an error.

(closes issue ASTERISK-22412)
Reported by: rmudgett
........

Merged revisions 397902 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 23:15:43 +00:00
Richard Mudgett 77561124b0 Cleanup core main on exit.
* Cleanup time zones on exit.

* Make exit clean/unclean report consistent for AMI and CLI in
really_quit().

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
      core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
      Modified
........

Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377136 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 377137 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 20:46:11 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Matthew Jordan f78290068a Fix a variety of potential buffer overflows
* chan_mobile: Fixed an overrun where the cind_state buffer (an integer array
  of size 16) would be overrun due to improper bounds checking. At worst, the
  buffer can be overrun by a total of 48 bytes (assuming 4-byte integers),
  which would still leave it within the allocated memory of struct hfp.  This
  would corrupt other elements in that struct but not necessarily cause any
  further issues.

* app_sms: The array imsg is of size 250, while the array (ud) that the data
  is copied into is of size 160.  If the size of the inbound message is 
  greater then 160, up to 90 bytes could be overrun in ud.  This would corrupt
  the user data header (array udh) adjacent to ud.

* chan_unistim: A number of invalid memmoves are corrected.  These would move
  data (which may or may not be valid) into the ends of these buffers.

* asterisk: ast_console_toggle_loglevel does not check that the console log
  level being set is less then or equal to the allowed log levels of 32.

* format_pref: In ast_codec_pref_prepend, if any occurrence of the specified
  codec is not found, the value used to index into the array pref->order
  would be one greater then the maximum size of the array.

* jitterbuf: If the element being placed into the jitter buffer lands in the
  last available slot in the jitter history buffer, the insertion sort attempts
  to move the last entry in the buffer into one slot past the maximum length
  of the buffer.  Note that this occurred for both the min and max jitter
  history buffers.

* tdd: If a read from fsk_serial returns a character that is greater then 32,
  an attempt to read past one of the statically defined arrays containing the
  values that character maps to would occur.

* localtime: struct ast_time and tm are not the same size - ast_time is larger,
  although it contains the elements of tm within it in the same layout.  Hence,
  when using memcpy to copy the contents of tm into ast_time, the size of tm
  should be used, as opposed to the size of ast_time.

* extconf: this treats ast_timing's minmask array as if it had a length of 48,
  when it has defined the size of the array as 24.  pbx.h defines minmask as
  having a size of 48.

(issue ASTERISK-19668)
Reported by: Matt Jordan
........

Merged revisions 362485 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362496 from http://svn.asterisk.org/svn/asterisk/branches/10



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19 02:40:55 +00:00
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51:16 +00:00
Tilghman Lesher a78b0af5ea Re-commit the verbose branch.
This change permits each verbose destination (consoles, logger) to have its
own concept of what the verbosity level is.  The big feature here is that
the logger will now be able to capture a particular verbosity level without
condemning each console to need to suffer that level of verbosity.
Additionally, a stray 'core set verbose' will no longer change what will go
to the log.

Review:  https://reviewboard.asterisk.org/r/1599/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 20:27:16 +00:00
Jeff Peeler e0ac582b5e Merged revisions 291791 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r291791 | jpeeler | 2010-10-14 13:45:02 -0500 (Thu, 14 Oct 2010) | 10 lines
  
  Add missing ifdefs for test framework and new locale code.
  
  (closes issue #18137)
  Reported by: ovi
  Patches: 
        18137_test_framework_ifdef.patch uploaded by wdoekes (license 717)
        18137_localelist_warning.patch uploaded by wdoekes (license 717)
  Tested by: ovi
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 18:46:54 +00:00
Tilghman Lesher 6d0e383321 Merged revisions 289543,289581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r289543 | tilghman | 2010-09-30 12:50:52 -0500 (Thu, 30 Sep 2010) | 2 lines
  
  More Solaris compatibility fixes
........
  r289581 | tilghman | 2010-09-30 15:23:10 -0500 (Thu, 30 Sep 2010) | 2 lines
  
  Solaris fixes.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-30 20:40:08 +00:00
Tilghman Lesher b0357dcc3e Support setting locale per-mailbox (changes date/time languages for email, pager messages).
(closes issue #14333)
 Reported by: klaus3000
 Patches: 
       20090515__issue14333.diff.txt uploaded by tilghman (license 14)
       app_voicemail.c-svn-trunk-rev211675-patch.txt uploaded by klaus3000 (license 65)
 Tested by: klaus3000


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-01 21:28:19 +00:00
Russell Bryant 420acb8f0a Fix build on linux.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13 15:35:30 +00:00
Tilghman Lesher 8d6ee962c7 Add kqueue(2) implementation to Asterisk in various places.
This will save a considerable amount of CPU on the BSDs, including Mac OS X,
as it eliminates several places in the code that we previously used a busy
loop.  Additionally, this adds a res_timing interface, using kqueue timers.

Review: https://reviewboard.asterisk.org/r/543/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13 05:37:31 +00:00
Russell Bryant 3da9f8ed19 Resolve more compiler warnings on FreeBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 12:03:07 +00:00
Tilghman Lesher 0c0bf14d99 Just in case of a race, send the signal on interrupt.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-18 15:45:26 +00:00
Tilghman Lesher 385a40226a Fix test_time on Mac OS X (and other platforms without inotify)
Reviewboard: https://reviewboard.asterisk.org/r/554/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16 19:34:01 +00:00
Tilghman Lesher da6ba8e60e Remove portions that weren't meant to be committed for the OS X compat fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08 05:15:01 +00:00
Tilghman Lesher e58fc610ae Change needed to make Mac OS X 10.6 happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08 05:12:55 +00:00
Tilghman Lesher 8e39288f61 Use nanosleep instead of poll.
This is not just because mmichelson suggested it, but also because Mac OS X puked on my poll().


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 22:10:25 +00:00
Tilghman Lesher 4aeb36b1c5 Compatibility fix for glibc 2.4
(Closes issue #14820)
Reported by: phsultan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 15:18:28 +00:00
Tilghman Lesher baf144c655 Picky, picky buildbots
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25 19:49:46 +00:00
Tilghman Lesher 4ac2fd4cde Use notification when timezone files change and re-scan then.
(closes issue #14300)
 Reported by: jamessan
 Patches: 
       20090127__bug14300.diff.txt uploaded by tilghman (license 14)
       20090224__bug14300.diff uploaded by jamessan (license 246)
 Tested by: jamessan
 Review: http://reviewboard.digium.com/r/136/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25 19:24:44 +00:00
Kevin P. Fleming 8d5deb312b Merged revisions 157859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
  
  the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
  
  with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
  
  while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 00:08:12 +00:00
Tilghman Lesher 529874de7b Add schedule extensions to app_meetme. In addition, the reporter found a
problem within strptime(3), which we are correcting here with ast_strptime().
(closes issue #11040)
 Reported by: DEA
 Patches: 
       20080910__bug11040.diff.txt uploaded by Corydon76 (license 14)
 Tested by: DEA


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-01 23:02:25 +00:00
Kevin P. Fleming 629861a705 Merged revisions 144924-144925 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r144924 | kpfleming | 2008-09-27 10:00:48 -0500 (Sat, 27 Sep 2008) | 6 lines
  
  improve header inclusion process in a few small ways:
  
    - it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose
    - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled
    - simplify the usage of some of these headers in the AEL-related stuff in the utils directory
........
  r144925 | kpfleming | 2008-09-27 10:13:30 -0500 (Sat, 27 Sep 2008) | 2 lines
  
  fix some minor issues with rev 144924
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27 15:52:56 +00:00
Tilghman Lesher 3dd4296de7 Merged revisions 103845 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r103845 | tilghman | 2008-02-20 11:53:00 -0600 (Wed, 20 Feb 2008) | 7 lines

Compat fix for Solaris
(closes issue #12022)
 Reported by: asgaroth
 Patches: 
       20080219__bug12022.diff.txt uploaded by Corydon76 (license 14)
 Tested by: asgaroth

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-20 18:28:00 +00:00
Terry Wilson 3570ad103d Added a new module, res_phoneprov, which allows auto-provisioning of phones
based on configuration templates that use Asterisk dialplan function and
variable substitution.  It should be possible to create phone profiles and
templates that work for the majority of phones provisioned over http. It
is currently only intended to provision a single user account per phone.
An example profile and set of templates for Polycom phones is provided.
NOTE: Polycom firmware is not included, but should be placed in
AST_DATA_DIR/phoneprov/configs to match up with the included templates.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 21:37:26 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Tilghman Lesher bd27085c00 Merged revisions 85921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85921 | tilghman | 2007-10-16 14:41:40 -0500 (Tue, 16 Oct 2007) | 4 lines

Also set up gmtoff (this is used in the %z gnu extension to strftime)
Reported and fixed by jcmoore
Closes issue #11002

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 19:47:16 +00:00
Russell Bryant 96d9f820e9 Merged revisions 82676 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82676 | russell | 2007-09-17 15:16:25 -0500 (Mon, 17 Sep 2007) | 4 lines

Put a memset in ast_localtime() instead of a couple places in app_voicemail
to prevent the problem everywhere instead of just a couple of places.
(related to issue #10746)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 20:19:58 +00:00
Tilghman Lesher 22436131f7 Merged revisions 82291 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82291 | tilghman | 2007-09-12 16:28:33 -0500 (Wed, 12 Sep 2007) | 2 lines

Oops, wrong location for FreeBSD zone files

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 21:32:24 +00:00
Tilghman Lesher 82cf384e03 Merged revisions 82285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82285 | tilghman | 2007-09-12 15:12:06 -0500 (Wed, 12 Sep 2007) | 4 lines

Working on issue #10531 exposed a rather nasty 64-bit issue on ast_mktime, so we
updated the localtime.c file from source.  Next we'll have to write ast_strptime
to match.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 21:25:57 +00:00
Tilghman Lesher 81bc1d7af5 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:47:20 +00:00
Kevin P. Fleming 5fdba27ea2 Merged revisions 69392 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69392 | kpfleming | 2007-06-14 16:50:40 -0500 (Thu, 14 Jun 2007) | 2 lines

use ast_localtime() in every place localtime_r() was being used

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 22:09:20 +00:00
Tilghman Lesher 9d74ea97c0 Merged revisions 51256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r51256 | tilghman | 2007-01-18 15:14:24 -0600 (Thu, 18 Jan 2007) | 10 lines

Merged revisions 51255 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51255 | tilghman | 2007-01-18 15:11:34 -0600 (Thu, 18 Jan 2007) | 2 lines

If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 21:15:59 +00:00
Jason Parker 05d6c4a2d0 Merged revisions 48906 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48906 | qwell | 2006-12-22 16:33:46 -0600 (Fri, 22 Dec 2006) | 2 lines

Minor fixes for Solaris.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-22 22:34:31 +00:00
Kevin P. Fleming 018a9c86e4 Merged revisions 48521 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48521 | kpfleming | 2006-12-16 14:12:41 -0600 (Sat, 16 Dec 2006) | 2 lines

since we really, really have to have autoconfig.h included before all other headers (especially system headers), the Makefile will now force it to happen (this will fix build problems with files like ast_expr2f.c, where we can't control the inclusion order in the file itself)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-16 20:19:19 +00:00
Kevin P. Fleming 0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00