Skip to content
Snippets Groups Projects
  1. Feb 22, 2025
  2. Feb 20, 2025
  3. Feb 19, 2025
  4. Feb 18, 2025
  5. Feb 08, 2025
  6. Feb 07, 2025
  7. Feb 05, 2025
    • Petter Reinholdtsen's avatar
      Avoid crash when inserting comment with no value. · 4818c5b5
      Petter Reinholdtsen authored
      This fixes the following issue as reported by valgrind:
      
      ==2828942== Invalid read of size 1
      ==2828942==    at 0x4847743: __strcmp_sse42 (vg_replace_strmem.c:927)
      ==2828942==    by 0x485505A: oggz_comment_cmp (oggz_comments.c:219)
      ==2828942==    by 0x485505A: oggz_comment_cmp (oggz_comments.c:213)
      ==2828942==    by 0x485B243: oggz_vector_tail_insertion_sort (oggz_vector.c:237)
      ==2828942==    by 0x485B243: oggz_vector_insert_p (oggz_vector.c:286)
      ==2828942==    by 0x4855B5F: oggz_comments_decode (oggz_comments.c:664)
      ==2828942==    by 0x485A86D: oggz_auto_read_comments (oggz_auto.c:1510)
      ==2828942==    by 0x4856E43: oggz_read_sync (oggz_read.c:456)
      ==2828942==    by 0x485738B: oggz_read (oggz_read.c:650)
      ==2828942==    by 0x10AD64: validate (oggz-validate.c:445)
      ==2828942==    by 0x10A431: main (oggz-validate.c:594)
      ==2828942==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
      ==2828942==
      ==2828942==
      ==2828942== Process terminating with default action of signal 11 (SIGSEGV)
      ==2828942==  Access not within mapped region at address 0x0
      ==2828942==    at 0x4847743: __strcmp_sse42 (vg_replace_strmem.c:927)
      ==2828942==    by 0x485505A: oggz_comment_cmp (oggz_comments.c:219)
      ==2828942==    by 0x485505A: oggz_comment_cmp (oggz_comments.c:213)
      ==2828942==    by 0x485B243: oggz_vector_tail_insertion_sort (oggz_vector.c:237)
      ==2828942==    by 0x485B243: oggz_vector_insert_p (oggz_vector.c:286)
      ==2828942==    by 0x4855B5F: oggz_comments_decode (oggz_comments.c:664)
      ==2828942==    by 0x485A86D: oggz_auto_read_comments (oggz_auto.c:1510)
      ==2828942==    by 0x4856E43: oggz_read_sync (oggz_read.c:456)
      ==2828942==    by 0x485738B: oggz_read (oggz_read.c:650)
      ==2828942==    by 0x10AD64: validate (oggz-validate.c:445)
      ==2828942==    by 0x10A431: main (oggz-validate.c:594)
      
      The problem is triggered when oggz_comments_decode() is calling
      _oggz_comment_add_byname() with NULL as its third argument.  Not sure what should
      happen with a comment consisting only of a name and no value, but the provided
      patch block the crash from occuring.
      
      Fixes #13
      4818c5b5
    • Petter Reinholdtsen's avatar
      19d2e3cc
    • Petter Reinholdtsen's avatar
      Corrected CI artifacts statement. · 32759208
      Petter Reinholdtsen authored
      32759208
    • Petter Reinholdtsen's avatar
    • Petter Reinholdtsen's avatar
      111c00f9
    • Petter Reinholdtsen's avatar
      Bring OggzStreamContent enum in line with documented return values. · b22087a2
      Petter Reinholdtsen authored
      According to the documentation of oggz_stream_get_content(), it can
      return values OGGZ_ERR_BAD_OGGZ and OGGZ_ERR_BAD_SERIALNO, neither
      which is part of the return type enum OggzStreamContent.  This causes the
      following compiler warning and make it impossible to check the return
      value of this method without a compiler warning:
      
      oggz_stream.c: In function ‘oggz_stream_get_content’:
      oggz_stream.c:55:28: warning: implicit conversion from ‘enum OggzError’ to ‘OggzStreamContent’ [-Wenum-conversion]
         55 |   if (oggz == NULL) return OGGZ_ERR_BAD_OGGZ;
            |                            ^~~~~~~~~~~~~~~~~
      oggz_stream.c:58:30: warning: implicit conversion from ‘enum OggzError’ to ‘OggzStreamContent’ [-Wenum-conversion]
         58 |   if (stream == NULL) return OGGZ_ERR_BAD_SERIALNO;
            |                              ^~~~~~~~~~~~~~~~~~~~~
      
      This fix provide new enum members OGGZ_CONTENT_ERR_BAD_OGGZ and
      OGGZ_CONTENT_ERR_BAD_SERIALNO with identical integer values as the
      OGGZ_ERR_* values, ensuring ABI compatilibity while providing types
      accepted by the compiler.
      
      Fixes #16
      b22087a2
    • Petter Reinholdtsen's avatar
      bb35091d
    • Petter Reinholdtsen's avatar
      Corrected various compiler warnings when using -DDEBUG. · 59b21314
      Petter Reinholdtsen authored
      Use PRId64 or %zu where appropriate.  Handle NULL values.
      59b21314
    • Petter Reinholdtsen's avatar
      Introduced new configure option --enable-debug to build with -DDEBUG. · 4e584373
      Petter Reinholdtsen authored
      This activate several blocks of code that should compile.  Some of them did not
      after the introduction of UNUSED().  Flag the arguments used with -DDEBUG
      with a new macro NDUNUSED().
      
      There are several new compiler warnings in the DEBUG protected code.  When these
      are fixed, --enable-gcc-werror could be enabled for DEBUG builds to avoid
      reintroducing such problems.
      4e584373
    • Petter Reinholdtsen's avatar
      Made sure PRI_OGGZ_OFF_T setting match type of off_t implementation. · dafe1d33
      Petter Reinholdtsen authored
      This avoid a compiler warning about incorrect formatting string.
      dafe1d33
Loading