Ticket #2000 (closed defect: fixed)

Opened 9 months ago

Last modified 8 months ago

Prevent overflow on pj_generate_unique_string() for android

Reported by: riza Owned by: bennylp
Priority: normal Milestone: release-2.7
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

There is a bug in pj_generate_unique_string() from guid_android.c which lead to overflow/leak with this error:

JNI ERROR (app bug): local reference table overflow (max=512)
local reference table dump:
  Last 10 entries (of 512):
      511: 0x12ec2f80 java.util.UUID
      510: 0x6fc02f38 java.lang.Class<java.util.UUID>
      509: 0x130a7e20 java.lang.String "4cb26510-cdfb-4a... (36 chars)
      508: 0x12ec2f40 java.util.UUID
      507: 0x6fc02f38 java.lang.Class<java.util.UUID>
      506: 0x12fcdd00 java.lang.String "22383c0c-14e7-46... (36 chars)
      505: 0x12ec2e80 java.util.UUID
      504: 0x6fc02f38 java.lang.Class<java.util.UUID>
      503: 0x12fcd880 java.lang.String "9f6a1bfc-06b4-46... (36 chars)
      502: 0x12ec2e40 java.util.UUID
  Summary:
      170 of java.lang.Class (1 unique instances)
      169 of java.lang.String (169 unique instances)
        1 of byte[] (533 elements)
        1 of byte[] (753 elements)
        1 of byte[] (1217 elements)
      170 of java.util.UUID (170 unique instances)

This error will be raised after multiple calls to pj_generate_unique_string().

Thanks to Esed Alihodzic for the report and patch.

Change History

comment:1 Changed 9 months ago by riza

In r5563:

Re #2000: Prevent overflow on pj_generate_unique_string() for android.

Thanks to Esed Alihodzic for the report and patch.

comment:2 Changed 8 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.