Uploaded image for project: 'Apache Gora'
  1. Apache Gora
  2. GORA-526

Potential null dereference in AvroSerializer#analyzePersistent

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 0.9
    • Component/s: None
    • Labels:
      None

      Description

      In ctor:

          if (PersistentBase.class.isAssignableFrom(dataStore.getPersistentClass())) {
            persistentSchema = ((PersistentBase) dataStore.getBeanFactory().getCachedPersistent()).getSchema();
          } else {
            persistentSchema = null;
      

      In updateByQuery, persistentSchema is passed to CassandraQueryFactory.getUpdateByQueryForAvro() which dereferences the schema without checking:

        public boolean updateByQuery(Query query) {
          List<Object> objectArrayList = new ArrayList<>();
          String cqlQuery = CassandraQueryFactory.getUpdateByQueryForAvro(mapping, query, objectArrayList, persistentSchema);
      

        Activity

        Hide
        lewismc Lewis John McGibbney added a comment -

        Madhawa Gunasekara can you please have a look for this and possibly add a test if you can?

        Show
        lewismc Lewis John McGibbney added a comment - Madhawa Gunasekara can you please have a look for this and possibly add a test if you can?
        Hide
        Madhawa Gunasekara Madhawa Gunasekara added a comment -
        Show
        Madhawa Gunasekara Madhawa Gunasekara added a comment - Sure Lewis John McGibbney

          People

          • Assignee:
            madhawa Madhawa Gunasekara
            Reporter:
            yuzhihong@gmail.com Ted Yu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development